Haas M98 Subprogram Call
Haas M98 Sub Program Call code is used to call subroutines (subprograms).
The subprogram must be in the program list, the subprogram must end with M99.
CNC machinists can even choose the number the subroutine will be repeated.
What is Sub Programming?
Subprograms are normal cnc programs which are called from a program (normally called main-program) to add some kind of repeatable machining operation.
Haas M97 Local Subprogram Call
Haas has a M97 Local-subroutine-call command to call a subroutine (subprogram) which resides inside the calling program (main-program).
Haas M97 local subprogram call (with cnc program example) has already been briefly described here Haas CNC M97 Local Sub-Program Call with CNC Program Example.
What are Sub-Programs?
Haas M98 Subprogram Call Format
M98 P… L…
P – program number being called.
L – number of repetitions subprogram will be called.
As the program being called (Subprogram) must be in program list
and subprogram must end with M99.
Haas M98 Subprogram Example
O0001 (Main Program number) M98 P100 L4; (Call sub-program O0100 – repeat subprogram 4 times) M30 (End of program)
O0100 (Sub-program Number) G00 G90 G55 X0 Z0 (N line that will run after M98 P100 is run) S500 M03 G00 Z-.5 G01 X.5 F100. G03 Z... G01 X0 Z1. F50. G91 G28 Z0 G90 M99 (sub-program end, return to main-program)