M98 Execute subprogram
Fadal M-code · Mill
Calls program P as a subprogram L times. This is the Format 2 sub call. Format 1 uses L word subroutines.
Format
M98 P [L]
Addresses
| Address | What it does |
|---|---|
P | Program number to call |
L | Number of repeats |
How it works
Non modal.
Example program
N1 G0 G40 G49 G80 G90 G17 (FORMAT 2 SAFE START)
N2 T1 M6 (1-2 END MILL)
N3 G0 G90 G54 X0. Y0. S3000 M3
N4 G43 H1 Z.1 M8
…
N2 T1 M6 (1-2 END MILL)
N3 G0 G90 G54 X0. Y0. S3000 M3
N4 G43 H1 Z.1 M8
…
The full 7-line example is in the app. Example is in inch. Check offsets and clearances first.
Watch out for
- The subprogram ends with M99.
- Format 1 calls a sub with an L word, L NN KK. L0203 runs sub 2 three times.
- Fadal macro lines start with #, such as #V1=5 or #IF V1 GT 3 THEN GOTO :END. Keep them on their own lines.
Related codes
M98 on other controls
The same number can mean something different on another control.
| Control | Meaning |
|---|---|
| Fanuc | Subprogram call |
| Haas NGC | 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 |
| Swiss (Citizen Star) | Subprogram call |
Every M-code for Fadal 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 Fadal M-codes