6 - 135
6 MOTION PROGRAMS FOR POSITIONING CONTROL
(4) The GOTO statement cannot cause execution to go into or come out of the DO
statement.
[Program Example]
The program for which jumps to the specified line if the condition is satisfied.
O0110 ;
N1 #@0=0 ;
N2 G91 G00 X25. Y50. ;
N3 WHILE [#@0 LT3] D01 ;
N4 G03 X0. Y0. I25. J0. F100. ;
N5 #@0=#@0+1 ;
N6 END1 ;
N7 G28 X0. Y0. ;
N8 M02 ;
%
.................
(Note-1)
(Note-2)
Y
X
50
75
50
25
25
0
(Note-1) : N3 to N6 are repeated while variable #@0 < 3 holds.
(Note-2) : Every time this block is executed once, 1 is added to variable #@0.
The above program ends after drawing a circle three times.
(Note) : Note that if the sequence No. (N
) is omitted in the above program,
the block No. changes as indicated below.
Program
Execution block No.
O0110 ;
0
#@0=0 ;
1
G91 G00 X25. Y50. ;
2
WHILE [#@0 LT3] DO1 ;
3
G03 X0. Y0. I25. J0. F100. ;
4
#@0=#@0+1 ;
5
END1 ;
—
G28 X0. Y0. ;
4
M02 ;
5
% —