Home › M-codes › Haas NGC › M98
M98 Subprogram call
Haas NGC M-code · Mill, Lathe
On mills: Subprogram call
Calls a separate subprogram stored in memory. L repeats it.
Format
M98 P [L]
Addresses
| Address | What it does |
|---|---|
P | Program number to call |
L | Number of times to repeat |
How it works
Not modal. Acts once on the line where it is commanded.
Example program
G90 G54 G00 X0. Y0. (POSITION)
M98 P1012 L3 (RUN PROGRAM O01012 THREE TIMES)
G00 Z1. (RETRACT)
M98 P1012 L3 (RUN PROGRAM O01012 THREE TIMES)
G00 Z1. (RETRACT)
Example is in inch. Check offsets and clearances first.
Watch out for
- The subprogram must be loaded on the control and end with M99.
- Use G65 if you need to pass arguments.
On lathes: Subprogram call
Calls a separate subprogram by number or by path. L repeats it. The subprogram ends with M99.
Format
M98 P [L] or M98 (path)
Addresses
| Address | What it does |
|---|---|
P | Program number to call |
L | Repeat count, 1 to 99 |
(path) | Device path and file name of the subprogram |
How it works
Non-modal.
Example program
M98 P100 L4 (CALL O00100 FOUR TIMES)
M30 (END MAIN)
O00100 (SUBPROGRAM)
G01 U-.1 F.01 (STEP IN)
…
M30 (END MAIN)
O00100 (SUBPROGRAM)
G01 U-.1 F.01 (STEP IN)
…
The full 5-line example is in the app. Example is in inch. Check offsets and clearances first.
Watch out for
- The control looks in the main program folder, then the folder in Setting 251.
- File paths are case sensitive.
Related codes
M98 on other controls
The same number can mean something different on another control.
| Control | Meaning |
|---|---|
| Fanuc | Subprogram call |
| Doosan (Fanuc) | Sub program call |
| DMG Mori MAPPS (Fanuc) | Sub-program call in NC memory |
| Mazak (EIA) | EIA → EIA Subprogram call |
| Okuma OSP | Subprogram call (Lathes & Mills) |
| Mitsubishi M70 M80 | Subprogram call |
| Brother Speedio | Subprogram call |
| Heidenhain TNC (ISO) | Machine open contours completely |
| LinuxCNC Tormach | Fanuc style subprogram call |
| Mach3 Mach4 | Subprogram call |
| Centroid CNC12 Acorn | Call subprogram |
| Hurco WinMax (NC) | Subprogram call |
| Fadal | Execute subprogram |
| Swiss (Citizen Star) | Subprogram call |
Every M-code for Haas NGC in your pocket. The app has the full example programs, search by number or shop word, a line decoder and calculators for tapping, threading and drilling.
Open M98 in the app All Haas NGC M-codes