7 MOTION PROGRAMS FOR POSITIONING CONTROL
7.16.33 Conditional branch using bit device (ON, OFF)
Bit device conditional
*Conditional expression of IF THEN or WHILE can also be described similarly.
(1) The ON/OFF status of the specified bit device is judged by the ON/OFF command
to see if it is true (1) or false (0).
By using this command in the conditional expression of IF or WHILE, a conditional
branch can be made with a bit device.
When used with a logical operator, this command enables a conditional branch
with multiple bit devices.
(2) [ ] of the conditional expression can be five levels deep including [ ] of a function.
An operational expression may be described in up to 72 characters in all. (Up to
the maximum number of characters in one block)
<When "ON" is specified>
IF [ON #M100] GOTO1 ;
<When "OFF" is specified>
IF [OFF #M100] GOTO1 ;
<When used with logical operator>
IF [ [ON #M100] AND [ON #M110] ] GOTO1 ;
(3) The device that may be specified after the ON/OFF command is the bit device
If a word device is specified, a "Format error" (error code : 560) occurs.
(4) The bit devices usable in the ON/OFF command are X, Y, M, B and F.
(5) The ON/OFF command is available for the conditional expressions of the program
control functions (IF GOTO, IF THEN, WHILE).
By describing this command in the conditional expression of
IF or WHILE, branches processing according to the ON/OFF status of
the specified bit device.
G T 1
ON/OFF device (X, Y, M, B, F)
ON/OFF command (describe OFF for OFF)
When M100 is ON, the result is true (1) and a branch to N01 is taken.
When M100 is OFF, the result is false (0) and the next block is executed.
When M100 is ON, the result is false (0) and the next block is executed.
When M100 is OFF, the result is true (1) and a branch to N01 is taken.
When M100 is ON and M110 is ON, a branch to N01 is taken.
If either of them is OFF, the next line is executed.
7 - 184