6 - 185
6 MOTION PROGRAMS FOR POSITIONING CONTROL
[Program Example]
(1) When M100 is ON, a branch to line N03 is taken.
N01 IF [ON #M100] GOTO3 ;
N02 G01 X100. F200. ;
N03 G00 X0. ;
Branches to line N03 if M100 is ON.
Executes the next line (N02) if M100 is OFF.
(2) Execution starts from the next line (THEN1 and later) if M200 is ON, or from
ELSE1 if it is OFF.
N01 IF [ON #M200] THEN1 ;
N02 G01 X100. F200. ;
N03 ELSE1 ;
N04 G00 X200. ;
N05 END1 ;
Executed when M200 is ON.
Executed when M200 is OFF.
(3) While M300 is OFF, the blocks within WHILE (N02, N03, N04) are executed
repeatedly.
N01 WHILE [OFF #M300] D02 ;
N02 G91 G01 X10. F100. ;
N03 #2010 = #2010 + 1 ;
N04 END2 ;
N05 G90 G00 X0. ;
Executes blocks within WHILE while M300 is OFF.
Executed when M300 turns ON.