M-Code

TechTipsMachining knowledge, made practical

CNC Programming Reference

M‑Code Engineering Reference

A searchable technical guide to the machine-level functions that coordinate spindle state, coolant, tool changes, program stops, auxiliary equipment, and CNC program flow.

i

Technical reference: ISO 6983 / FANUC-style conventions. M-function assignments are not completely universal. Machine builders and control integrators may remap auxiliary commands through the PLC or ladder logic. Always verify the control manual, machine manual, and approved setup documentation before execution.

23 reference entries common configuration-dependent uncommon
Code Machine function Milling Turning

Engineering Foundations

How M-Functions Coordinate CNC Execution

M-functions govern the machine actions that support, interrupt, or sequence cutting motion. Whereas G-functions primarily define geometry, coordinate systems, and interpolation modes, M-functions communicate operational states to the CNC and its machine interface: start or stop the spindle, enable coolant, initiate a tool change, pause execution, control auxiliary hardware, or transfer program flow to a subprogram.

Most controls permit only one M-function in a program block, and the point at which that function is executed relative to axis motion can depend on the control configuration. Because many M-functions are implemented through machine-builder PLC or ladder logic, identical code numbers may produce different behavior on different machines. Safe programming therefore requires confirmation of the installed control, machine options, interlocks, and recovery procedure—not merely recognition of the code itself.

Continue the Engineering Conversation

Receive practical machining guidance, CNC programming insights, tooling knowledge, and new technical resources from our engineering team.

No gated content. No additional requirements. Unsubscribe at any time.