
B–63682EN/01
12. PROGRAM CONFIGURATION
NC FUNCTION
77
When there are fixed sequences or frequently repeated patterns in a
program, programming can be simplified by entering these pattern as sub
programs to the memory. Sub program is called by M98, and M99
commands return from the sub program. The sub program can be nested
4 folds.
A sequence number in a sub program can also be specified for sub
program call.
O0001 ;
M98P1000 ;
M30 ;
O3000 ;
M99 ;
O1000 ;
M98P2000 ;
M99 ;
O2000 ;
M98P3000 ;
M99 ;
O4000 ;
M99 ;
M98P4000 ;
M99 ;
1–loop nesting
Main program Sub program
Sub program Sub program Sub program
2–loop nesting 3–loop nesting 4–loop nesting
Sequence number
M98 P fff ffff Q fffff ;
M99 ;
Sub program call
Return from sub program
If the number of repetitive calls is omitted, 1 is assumed.
When Q and a sequence number are omitted, the beginning of
the sub program is called.
Number of repetitive
calls
Subprogram number
12.4
SUB PROGRAM
Format