CNC Machinist Calculator Ultra

Home › M-codes › Mach3 Mach4 › M99

M99 Subprogram return

Mach3 Mach4 M-code · Mill

Returns from a subprogram to the block after the M98. In a main program it rewinds and runs again.

Format

M99 [P]

Addresses

AddressWhat it does
PMach4, sequence number to return to in the main program

How it works

Non modal.

Example program

O1000 (SUB PROGRAM)
G1 Z-0.5 F30.0 (FEED DOWN)
G12 I0.25 F20.0 (CUT CIRCLE)
G0 Z1.0 (RETRACT)
…

The full 5-line example is in the app. Example is in inch. Check offsets and clearances first.

Watch out for

Related codes

M98 · M47

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
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 Mach3 Mach4 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 Mach3 Mach4 M-codes

App Store Google Play