B-63324EN/03 PROGRAMMING 12.PROGRAM CONFIGURATION
- 271 -
A single call command can repeatedly call a subprogram up to 9999
times.
For compatibility with automatic programming systems, in the first
block, Nxxxx can be used instead of a subprogram number that follows
O (or :). A sequence number after N is registered as a subprogram
number.
Reference
See Operation II-8.1.1for the method of registering a subprogram.
Example
NOTE
1 The M98 and M99 code signal and strobe signal are
not output to the machine tool.
2 If the subprogram number specified by address P
cannot be found, an alarm (No. 0078) is output.
M98 P1002 L5;
X1000.0 M98 P1200;
Execution sequence of subprograms called from a main program
A subprogram can call another subprogram in the same way as a main program
calls a subprogram.
This command specifies "Call the subprogram (number 1002) five times in
succession."
A subprogram call command (M98P_) can be specified in the same block as a
move command.
This example calls the subprogram (number 1200) after an X movement.
1
2
3
Main program
N0010 ... ;
N0020 ... ;
N0030 M98 L2 P1010 ;
N0040 ... ;
N0050 M98 P1010 ;
N0060 ... ;
Subprogram
O1010 ... ;
N1020 ... ;
N1030 ... ;
N1040 ... ;
N0050 ... ;
N1060 ... M99 ;