Industrial manufacturing
Industrial Internet of Things | Industrial materials | Equipment Maintenance and Repair | Industrial programming |
home  MfgRobots >> Industrial manufacturing >  >> Manufacturing Equipment >> CNC Machine

Haas M98 Subprogram Call: Practical Guide & Sample Code

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.

Haas M98 Subprogram Call: Practical Guide & Sample Code

Haas CNC

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)

CNC Machine

  1. Master G02/G03 Circular Interpolation in CNC: Step‑by‑Step Example
  2. Haas G71 Roughing Cycle Program Example for Inside Roughing
  3. Master Haas CNC M97 Local Sub-Program Calls: Step-by-Step Example
  4. CNC Programming Fundamentals: Step‑by‑Step Tutorials & Sample Code
  5. Basic Heidenhain Milling Program Example: Step‑by‑Step CNC Code
  6. Haas G150 Pocket Milling Example: CNC Program for a Square Pocket with Island
  7. Haas G150 Pocket Milling Program: Step‑by‑Step Example for a 5mm×5mm×0.5mm Square Pocket
  8. Haas G150 Pocket Milling Example: Precision Round Island Machining
  9. CNC Subprogram Tutorial: Using G91 Incremental Mode for Precise Z‑Axis Control
  10. Efficient CNC Lathe Subprogram Calls for Repeated Pattern Cutting