M99 End of subprogram, or line jump
Fadal M-code · Mill
Ends a Format 2 subprogram and returns to the caller. With P it jumps to that line number instead.
Format
M99 [P]
Addresses
| Address | What it does |
|---|---|
P | Line number to jump to |
How it works
Non modal.
Example program
O2 (SUBPROGRAM, STEP DOWN .1)
N1 G91 G1 Z-.1 F10. (STEP DOWN)
N2 G90 X2. F20. (CUT)
N3 G0 Z.1 (UP)
…
N1 G91 G1 Z-.1 F10. (STEP DOWN)
N2 G90 X2. F20. (CUT)
N3 G0 Z.1 (UP)
…
The full 6-line example is in the app. Example is in inch. Check offsets and clearances first.
Watch out for
- Format 2 subprograms start with an O number and end with M99.
- M99 P in a main program makes an endless loop. Add an M0 or counter.
- Fadal macro variables are V1 to V100. R0 to R9 carry values into CNC lines.
Related codes
M99 on other controls
The same number can mean something different on another control.
| Control | Meaning |
|---|---|
| Fanuc | Subprogram end and return |
| Haas NGC | Subprogram return or loop |
| Doosan (Fanuc) | End of sub program |
| DMG Mori MAPPS (Fanuc) | Sub-program end Repeat program |
| Mazak (EIA) | EIA → EIA Return to main EIA program |
| Okuma OSP | Subprogram return (Lathes & Mills) |
| Mitsubishi M70 M80 | Subprogram end and return |
| Brother Speedio | Subprogram end |
| Heidenhain TNC (ISO) | Cycle call in a positioning block |
| LinuxCNC Tormach | Fanuc style subprogram return |
| Mach3 Mach4 | Subprogram return |
| Centroid CNC12 Acorn | Return from subprogram or macro |
| Hurco WinMax (NC) | Subprogram return |
| Swiss (Citizen Star) | Subprogram return or program loop |
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 M99 in the app All Fadal M-codes