is performed (the Pnnnn line must be in the same program).
M96 Example:
N05 M96 P10 Q8 (Test input #8, Door Switch, until closed);
N10 (Start of program loop);
.
. (Program that machines part);
.
N85 M21 (Execute an external user function)
N90 M96 P10 Q27 (Loop to N10 if spare input [#27] is 0);
N95 M30 (If spare input is 1 then end program);
M97 Local Sub-Program Call
This code is used to call a subroutine referenced by a line number (N) within
the same program. A code is required and must match a line number within the
same program. This is useful for simple subroutines within a program; does
not require a separate program. The subroutine must end with an M99. An Lnn
code in the M97 block will repeat the subroutine call that nn times.
M97 Example:
O00011 (M97 CALL)
T1 M06
G00 G90 G54 X0 Y0 S1000 M03
G43 H01 Z1.
G01 Z0 F20.
M97 P1000 L5 (L5 will cause the program to run the N1000
line ve times)
G00 G90 Z1.
M30
N1000 (N line that will run after M97 P1000 is run)
G01 G91 Z-0.1
G90 X2.
G91 Z-0.1
G90 X0
M99
M98 Sub Program Call
This code is used to call a subroutine, the format is M98 Pnnnn (Pnnnn is the
number of the program being called). The subprogram must be in the program
list, and it must contain an M99 to return to the main program. An Lnn count
can be put on the line containing the M98 and will cause the subroutine to be
called nn times before continuing to the next block.
O00012 (M98 CALL) (Main Program number)
T1 M06
G00 G90 G54 X0 Y0 S1000 M03
G43 H01 Z1.
G01 Z0 F20.
M98 P1000 L5 (Call Sub-program, Sub-program Number,
Loop 5 times)
G00 G90 Z1.
M30 (End of program)