Siemens M-codes19 codes
Siemens SINUMERIK M-code List
The SINUMERIK NCK predefines a short list of M-codes, M0 to M6, M17, M19, M30 and the M40 to M45 gear codes among them, and leaves everything else, coolant included, to the machine manufacturer. The Siemens table below follows ISO numbering, so a row outside that list is an ISO dialect code or the manufacturer's.
Siemens SINUMERIK M-code: 19 codes
Codes in colour link to a full page with a worked example and controller differences; the rest link to their row on the M-code list.
| Code | Function |
|---|---|
| M00 | Program StopUnconditional program stop. Machine stops and waits for operator to press cycle start. Spindle, coolant, and feed are stopped. |
| M01 | Optional StopConditional program stop. Machine stops only if Optional Stop switch is ON. Allows operator to skip stops during production runs. |
| M02 | Program EndEnds the program. Stops spindle, coolant, and feed. Cursor stays at M02 line. Does not rewind program. |
| M03 | Spindle On CWStarts the spindle rotating clockwise (when viewed from above on a vertical mill, or from the tailstock on a lathe). Standard direction for right-hand tooling. |
| M04 | Spindle On CCWStarts the spindle rotating counter-clockwise. Used for left-hand tooling, left-hand tapping, and specific operations. |
| M05 | Spindle StopStops the spindle rotation. Should be called before tool changes and at program end. |
| M06 | Tool ChangeExecutes automatic tool change. Swaps the current tool for the tool specified by the preceding T command. Machine goes through its tool change sequence. |
| M07 | Mist Coolant OnActivates mist coolant (air/oil mixture). Provides lubrication with minimal coolant volume. Good for aluminum and where flood coolant is undesirable. |
| M08 | Flood Coolant OnActivates flood coolant. Standard coolant delivery for most machining operations. Provides cooling, lubrication, and chip evacuation. |
| M09 | Coolant OffTurns off all coolant (both mist and flood). Should be called before tool changes and at program end. |
| M10 | ClampActivates workholding clamp or 4th axis clamp. Specific function varies by machine configuration. |
| M11 | UnclampReleases workholding clamp or 4th axis clamp. Specific function varies by machine configuration. |
| M19 | Spindle OrientationOrients the spindle to a specific angular position and locks it. Required for tool changes with orientation, some boring cycles, and live tooling operations. |
| M29 | Rigid TappingActivates rigid tapping mode where the spindle and Z-axis are electronically synchronized. Provides more accurate threading than floating tap holders, especially in harder materials. |
| M30 | Program End and RewindEnds the program and rewinds to the beginning. Stops spindle, coolant, and feed. Standard program ending code. |
| M48 | Enable Feedrate OverrideEnables feedrate override. Allows operator to adjust feed rate percentage during cutting. |
| M49 | Disable Feedrate OverrideDisables feedrate override. Machine runs at exactly programmed feed rate, ignoring override knob. |
| M98 | Subprogram CallCalls a subprogram. Execution transfers to the subprogram and returns to the next line after M98 completes. |
| M99 | Subprogram ReturnReturns from a subprogram to the calling program. Execution continues at the line after the M98 call. |
Where Siemens differs
- The NCK predefines M0 to M6, M17, M19, M30, M40 to M45 and M70. M7, M8 and M9 are not among them: they belong to the machine manufacturer.
- In ShopMill 7.2 on the 840D sl the coolant M function is held in display machine data: MD 9680 coolant I (M8 by default), MD 9681 coolant II (M7), MD 9668 both coolants at once and MD 9686 coolant off (M9).
- The ISO dialect manual lists M08 coolant on and M09 off among the general M functions, which the machine manufacturer defines, so a Fanuc-style M08 runs the coolant only where the builder has assigned it.
- T selects a tool and M6 activates it, offset included, so the length arrives with the tool change rather than from a G43 block. With tool management the tool is named,
T="DRILL85" M6, and D1 picks the cutting edge. - M17 is the native subprogram end and M30 the main program end; the reference table follows ISO numbering and lists M98 and M99 as the subprogram pair, which is the ISO dialect form.
- M29 rigid tapping is on the Siemens list in the reference, and it is an ISO dialect code: in ISO mode M29 switches the spindle to axis mode. The native language taps without a compensating chuck using G331 and G332.
- M13, M14, M21 to M23, M32, M33, M36, M37, M41, M42, M50, M51 and M60 are not on the Siemens list in the reference. M41 and M42 are missing only from the reference: the NCK predefines them as gear stages.
Frequently asked questions
Why is the Siemens M-code list shorter than the Fanuc one?
Because the SINUMERIK NCK predefines only a short set, M0 to M6, M17, M19, M30 and M40 to M45, and leaves the rest to the machine manufacturer. The reference table follows ISO numbering: it carries the predefined stops, spindle codes, M6 and M19, plus the coolant and subprogram pairs from the ISO dialect list.
Does a Siemens control use M08 for coolant?
Only where the machine manufacturer assigned it: the NCK predefines no coolant M function. ShopMill 7.2 holds the number in display machine data, with M8 as the default for coolant I, and the ISO dialect manual lists M08 as coolant on, defined by the manufacturer. See M07, M08 and M09: coolant.
How does a tool change work on a SINUMERIK?
T selects the tool and M6 activates it with its offset, so there is no G43 block afterwards. With tool management the tool is named rather than numbered and D picks the cutting edge. See M06: tool change.
What ends a Siemens subprogram?
M17 in the native language, with M30 ending the main program. M99 is the ISO dialect form. See M-code list.
Other controller lists
Last updated 11 Oct 2026