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.

CodeFunctionNotes
M00Program StopUnconditional program stop. Machine stops and waits for operator to press cycle start. Spindle, coolant, and feed are stopped.Use for mandatory operator intervention: part flip, inspection, manual deburr.
M01Optional StopConditional program stop. Machine stops only if Optional Stop switch is ON. Allows operator to skip stops during production runs.Controlled by Optional Stop switch on control panel. Ignored when switch is off.
M02Program EndEnds the program. Stops spindle, coolant, and feed. Cursor stays at M02 line. Does not rewind program.Use M30 instead for most applications - it rewinds to program start.
M03Spindle 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.Always verify S value is set before M03. Allow dwell (G04) after spindle start for heavy cuts.
M04Spindle On CCWStarts the spindle rotating counter-clockwise. Used for left-hand tooling, left-hand tapping, and specific operations.Used with left-hand taps (G74), left-hand helix end mills, and specific boring operations.
M05Spindle StopStops the spindle rotation. Should be called before tool changes and at program end.Spindle continues to coast - may need dwell for complete stop before tool change.
M06Tool ChangeExecutes automatic tool change. Swaps the current tool for the tool specified by the preceding T command. Machine goes through its tool change sequence.CRITICAL: Ensure safe Z position before M06. Many machines auto-retract, but always verify.
M07Mist Coolant OnActivates mist coolant (air/oil mixture). Provides lubrication with minimal coolant volume. Good for aluminum and where flood coolant is undesirable.Not all machines have mist coolant capability. Check machine configuration.
M08Flood Coolant OnActivates flood coolant. Standard coolant delivery for most machining operations. Provides cooling, lubrication, and chip evacuation.Turn on after spindle start, turn off before spindle stop to prevent splashing.
M09Coolant OffTurns off all coolant (both mist and flood). Should be called before tool changes and at program end.Always turn off coolant before spindle stop to prevent coolant spray.
M10ClampActivates workholding clamp or 4th axis clamp. Specific function varies by machine configuration.Function is machine-specific. May control rotary axis clamp, pallet clamp, or custom fixture.
M11UnclampReleases workholding clamp or 4th axis clamp. Specific function varies by machine configuration.Function is machine-specific. May control rotary axis clamp, pallet clamp, or custom fixture.
M19Spindle OrientationOrients the spindle to a specific angular position and locks it. Required for tool changes with orientation, some boring cycles, and live tooling operations.Required before G76 fine boring, some ATC machines, and B-axis live tooling on lathes.
M29Rigid 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.Requires spindle encoder for synchronization. No need for tension/compression tap holder. On Haas, rigid tapping is default in G84.
M30Program End and RewindEnds the program and rewinds to the beginning. Stops spindle, coolant, and feed. Standard program ending code.Preferred over M02 for most applications. Program ready to run again after M30.
M48Enable Feedrate OverrideEnables feedrate override. Allows operator to adjust feed rate percentage during cutting.
M49Disable Feedrate OverrideDisables feedrate override. Machine runs at exactly programmed feed rate, ignoring override knob.Use for critical feed rates like threading or tapping where override would cause problems.
M98Subprogram CallCalls a subprogram. Execution transfers to the subprogram and returns to the next line after M98 completes.Subprogram must end with M99. Useful for repeated patterns and tool paths.
M99Subprogram ReturnReturns from a subprogram to the calling program. Execution continues at the line after the M98 call.Must be at end of every subprogram. In main program, M99 loops back to start.

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