Heidenhain M-codes – reference table

Complete reference table of Heidenhain TNC M-codes from M00 to M204, including TCPM (M128), machine-based coordinates (M91/M92) and feed per revolution (M136).

M-codes – called miscellaneous functions on Heidenhain controls – switch machine functions such as the spindle, coolant, and program run. Some of them are machine-dependent and defined by the machine tool builder; the manual of your specific TNC control describes their exact behavior.

Essential M-codes

These are the M-codes you will use most often in day-to-day work on a Heidenhain control.

CodeDescription
M03Spindle ON clockwise
M05Spindle STOP
M08Coolant ON
M09Coolant OFF
M30Same function as M02 (end of program)
M91In the positioning block: coordinates refer to the machine zero point
M92In the positioning block: coordinates refer to a position defined by the machine manufacturer, e.g. the tool change position
M94Reduce the rotary axis display to a value below 360°
M99Blockwise cycle call
M116Feed rate for rotary axes in mm/min
M126Shortest-path traverse of rotary axes
M128Maintain the position of the tool tip when positioning tilting axes (TCPM)
M129Reset M128
M130In the positioning block: points refer to the untilted coordinate system
M136Feed rate F in millimeters per spindle revolution
M137Reset M136
M140Retract from the contour in the tool axis direction
M150Suppress limit switch message

Full reference

All M-codes at a glance, sorted by number.

CodeDescription
M00Program STOP / spindle STOP / coolant OFF
M01Optional program STOP
M02Program STOP / spindle STOP / coolant OFF / clear the status display if configured (depends on machine parameter) / return to block 1
M03Spindle ON clockwise
M04Spindle ON counterclockwise
M05Spindle STOP
M06Tool change / program STOP (machine-dependent function) / spindle STOP
M08Coolant ON
M09Coolant OFF
M13Spindle ON clockwise / coolant ON
M14Spindle ON counterclockwise / coolant ON
M30Same function as M02
M89Free miscellaneous function or cycle call, modally effective (machine-dependent function)
M91In the positioning block: coordinates refer to the machine zero point
M92In the positioning block: coordinates refer to a position defined by the machine manufacturer, e.g. the tool change position
M94Reduce the rotary axis display to a value below 360°
M97Machine small contour steps
M98Machine open contours completely
M99Blockwise cycle call
M101Automatic tool change with a replacement tool when the maximum tool life has expired
M102Reset M101
M107Suppress the error message for replacement tools with oversize
M108Reset M107
M109Constant contouring speed at the tool cutting edge (feed rate increase and reduction)
M110Constant contouring speed at the tool cutting edge (feed rate reduction only)
M111Reset M109/M110
M116Feed rate for rotary axes in mm/min
M117Reset M116
M118Superimpose handwheel positioning during program run
M120Pre-calculate the radius-compensated contour (LOOK AHEAD)
M126Shortest-path traverse of rotary axes
M127Reset M126
M128Maintain the position of the tool tip when positioning tilting axes (TCPM)
M129Reset M128
M130In the positioning block: points refer to the untilted coordinate system
M136Feed rate F in millimeters per spindle revolution
M137Reset M136
M138Selection of tilting axes
M140Retract from the contour in the tool axis direction
M141Suppress touch probe monitoring
M143Delete basic rotation
M144Compensate the machine kinematics in ACTUAL/NOMINAL positions at the end of the block
M145Reset M144
M148Automatically retract the tool from the contour at an NC stop
M149Reset M148
M150Suppress limit switch message
M197Round corners
M200–M204Laser cutting functions