Program Control; Unconditional Branching, Conditional Branching, Waiting - Mitsubishi Electric CR750-Q Instruction Manual

Cr750/cr751/cr760 series
Hide thumbs Also See for CR750-Q:
Table of Contents

Advertisement

4.1.3 Program control

The program flow can be controlled with branching, interrupting, subroutine call, and stopping, etc.

(1) Unconditional branching, conditional branching, waiting

The flow of the program to a specified step can be set as unconditional or conditional branching.
*Command word
Command word
GoTo
On GoTo
If Then Else
(Instructions written in one
step)
If Then
Else
End If
(Instructions written in
several steps)
Select
Case
End Select
Wait
*Statement example
Statement example
GoTo *FN....................................................
ON M1 GoTo *L1, *L2, *L3 .........................
If M1=1 Then *L1........................................
If M1=1 Then *L2 Else *L2 .........................
If M1=1 Then ..............................................
M2=1
M3=2
Else
M2=-1
M3=-2
EndIf
Select M1 ...................................................
Case 10 .....................................................
:
Break
Case IS 11.................................................
:
Break
Case IS <5 ................................................
:
Break
Case 6 TO 9 ..............................................
:
Break
.......................................................
Default
:
Break
End Select ..................................................
Wait M_In(1)=1
Jumps unconditionally to the designated step.
Jumps according to the value of the designated variable. The value conditions follow the
integer value order.
Executes the command corresponding to the designated conditions.. The value conditions
can be designated randomly. There is only one type of condition per command statement.
If the conditions are met, the instruction after Then is executed. If the conditions are not
met, the instruction after Else is executed. They are written in one step.
Several steps can be processed according to the specified variables and specified
conditions of the values. It is possible to specify any conditions for values. Only one type
of condition is allowed for one instruction. If the conditions are met, the steps following
Then until the Else step are executed. If the conditions are not met, the steps after Else
until End IF are executed.
Jumps according to the designated variable and the designated conditions of that value.
The value conditions can be designated randomly.
Multiple types of conditions can be designated per command statement.
Waits for the variable to reach the designated value.
Jumps unconditionally to the label FN step.
If the numeric variable M1 value is 1, jumps to step *L1, if 2 jumps to step *L2, and if 3 jumps to step
*L3. If the value does not correspond, proceeds to next step.
If the numeric variable M1 value is 1, branches to step *L1. If not, proceeds to the next step.
If the numeric variable M1 value is 1, branches to step *L1. If not, branches to step *L2.
If the numerical variable of M1 is 1, the instructions M2 = 1 and M3 = 2 are executed. If the value of M1
is different from 1, the instructions M2 = -1 and M3 = -2 are executed.
Branches to the Case statement corresponding to the value of numeric variable M1.
If the value is 10, executes only between Case 10 and the next Case 11.
If the value is 11, executes only between Case 11 and the next Case IS <5.
If the value is smaller than 5, executes only between Case IS <5 and next Case 6 TO 9.
If value is between 6 and 9, executes only between Case 6 TO 9 and next Default.
If value does not correspond to any of the above, executes only between Default and next End Select.
Ends the Select Case statement.
Waits for the input signal bit 1 to turn ON.
Explanation
Explanation
MELFA-BASIC V functions 4-113
4MELFA-BASIC V

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cr750Cr751-qCr751-dCr760-dCr760-qCr750-d

Table of Contents