
12. PROGRAM CONFIGURATION
12.1 Main Program and Subprogram
(ii) If the M99 command is executed in the main program, control returns to the
start of the main program.
For example, a “IM99;” block is inserted in the
proper position of the main program and the optional block skip is off, M99
is executed, and control returns to the start of the main program and the
program is executed again.
If the optional block skip
passed to the next block.
is turned on,
‘VM99;” is omitted and control is
Main program
NO01 0
.
9
NO020
.
Y
NO030
.
9
N0040M98P1010 ;
NO050
;
NO060
;
NO070
;
Subprogram
7
01010;
;
N1020
;
N1030
;
Nlb40
;
N1050
;
N1060
.
I
<
N1070M99P0070 ;
Fig. 12.1 Processing Sequence with Address P
If “/M99PG;“ has been inserted, control does not return to the start, but
returns to the block whose sequence number is “,I’. The processing time
for return to sequence number n is longer than return to the start.
Optional block
skip OFF
NO01 0
;
,N0020
.
9
NO030
.
s
NO040
.
I
NO050
.
9
NO060
.
Y
- /N0070M99P0030 ;
Optional block
NO080
skip OFF
;
N0090M02; ;
(iii) A subprogram can be executed just like* the main program by searching for
the beginning of the subprogram from the MDI and performing programmed
operation. (Refer to II 9.2 for the search operation).
In this case, if the M99 command is executed, control returns to the top of
the subprogram and execution is repeated.
If ” M99Pg;” is executed,
control returns to the block whose sequence number is “n” and execution
is repeated.
In the above operation, if you want to stop execution, insert VM02;” or the
“lM30;” at the appropriate position. When the optional block skip switch is
turned off, the above command is executed and the program is terminated.
In the example below, execution will continue while the optional block skip is
on and will stop when the optional block skip is turned off.
1-41 .