Home › M-codes › Siemens 808D ISO › M99
M99 Subprogram end / Subprogram end and return
Siemens 808D ISO M-code · Mill, Lathe
On mills: Subprogram end
Ends a subprogram and returns to the calling program. With P it jumps to block N of that number. In a main program it restarts the program.
Format
Addresses
| Address | What it does |
|---|---|
P | Block number to continue at |
How it works
Non-modal.
Example program
Y10. (MORE MOVES)
G90 (ABSOLUTE AGAIN)
M99 (BACK TO CALLING PROGRAM)
Example is in inch. Check offsets and clearances first.
Watch out for
- The block number is searched forward first, then back toward the start.
- M99 at the end of a main program loops it forever. Use it only on purpose, such as a warm up loop.
On lathes: Subprogram end and return
Ends a subprogram and returns to the block after the call. M99 P jumps to block N instead. In a main program M99 restarts it from the top.
Format
Addresses
| Address | What it does |
|---|---|
P | Block number N to return to |
How it works
Non-modal.
Example program
G00 U4.0 (RETRACT)
G00 W-8.0 (STEP TO NEXT GROOVE)
M99 (BACK TO CALLING PROGRAM)
Example is in inch. Check offsets and clearances first.
Watch out for
- The control searches forward from the call for the P block number, then backward if not found.
- M99 at the end of a main program loops it forever. Use it only with a bar feeder or part counter that stops it.
Machine builders set many M codes, and they change by model and options. Check the M code list for your machine.
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 |
| Fadal | End of subprogram, or line jump |
| Swiss (Citizen Star) | Subprogram return or program loop |
Every M-code for Siemens 808D ISO 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 Siemens 808D ISO M-codes