CNC Machinist Calculator Ultra

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

M99 [P]

Addresses

AddressWhat it does
PBlock number to continue at

How it works

Non-modal.

Example program

G91 G01 X10. F500. (SUBPROGRAM MOVES)
Y10. (MORE MOVES)
G90 (ABSOLUTE AGAIN)
M99 (BACK TO CALLING PROGRAM)

Example is in inch. Check offsets and clearances first.

Watch out for

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

M99 [P]

Addresses

AddressWhat it does
PBlock number N to return to

How it works

Non-modal.

Example program

G01 U-4.0 F0.05 (SUBPROGRAM, PLUNGE GROOVE)
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

Machine builders set many M codes, and they change by model and options. Check the M code list for your machine.

Related codes

M98 · G65

M99 on other controls

The same number can mean something different on another control.

ControlMeaning
FanucSubprogram end and return
Haas NGCSubprogram 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 OSPSubprogram return (Lathes & Mills)
Mitsubishi M70 M80Subprogram end and return
Brother SpeedioSubprogram end
Heidenhain TNC (ISO)Cycle call in a positioning block
LinuxCNC TormachFanuc style subprogram return
Mach3 Mach4Subprogram return
Centroid CNC12 AcornReturn from subprogram or macro
Hurco WinMax (NC)Subprogram return
FadalEnd 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

App Store Google Play