Printed from Kezuriba (kezuriba.net/en/nc/m06/)
M06
Machining centerTool change (ATC)
Format and notes
T_ M06
- T selects the next tool, and M06 swaps it with the tool in the spindle
- Whether it is commanded after returning to the change position (Z zero, 2nd reference point, etc.) or M06 returns there automatically depends on the machine
- On lathes, turret indexing is normally done by the T code alone (M06 is not used)
Most M codes are assigned by the machine builder (the Siemens ISO dialect manual leaves M00–M89 to the machine tool maker). The same number can mean different things on different machines, so always check your machine’s manual.
Full guide with examples: Machining center programming basics (practise G54, G43 and G41 in a simulator)
Try it in the simulator (machining center)
T selects the next tool and M06 changes it. Re-apply G43 H_ after the change because the tool length is different.
Simulator with exercises: Machining center page
Differences between controls and machines
The same code can be written or assigned differently depending on the CNC control and the machine builder. Always check your machine’s manual.
| Source | Machine | Item | Detail |
|---|---|---|---|
| Haas | Machining center | Notes | M16 is also tool changeHaas mills also have M16 (Tool Change) |
| Saitama Univ. workshop text | Machining center | Format | T#100 T00 M06On the training machine, T is written twice (the next tool is staged by specifying T00). A machine-specific format example |
Frequently asked questions about M06
- What is M06 (Tool change (ATC)) used for and how is it formatted in a CNC program?
- M06 commands "Tool change (ATC)" on Machining center. The standard program format is "T_ M06". T selects the next tool, and M06 swaps it with the tool in the spindle
- Is M06 a modal code or a one-shot (non-modal) code?
- Whether M06 acts modally or as a single-block command depends on the CNC control and the machine builder’s PLC ladder implementation. Check your machine’s active modal status screen and programming manual before running in auto mode.
- Does M06 work differently on machining centers (mills) versus CNC lathes?
- M06 is primarily used on Machining center. Depending on the machine type and the lathe G-code system (System A, B, or C), this code may be unavailable or assigned to a different function, so verify against your machine tool manual.
- Are there differences in M06 across FANUC, Mitsubishi, Okuma, Haas, and Siemens controls?
- Yes. Control builders such as FANUC, Mitsubishi Electric (M80/M800), Okuma (OSP), Haas, Mazak, Siemens (SINUMERIK ISO dialect), and Heidenhain can differ in argument letters, decimal-point rules, and optional parameters for M06. Review the control comparison table above and verify the exact syntax in your machine’s programming manual before proving out the program.
Sources
The meaning of this code agrees in two or more sources from different publishers. Explanations are written in our own words.
- Mitsubishi Electric — The Basics of CNC Machining Programming (for Machining center) e-Learning material (PDF) mitsubishielectric.com
- Haas Automation, Inc. — Mill Operator's Manual – 18 Mill M-Codes (online version) haascnc.com
- National Institute of Standards and Technology (NIST), USA — The NIST RS274NGC Interpreter – Version 3 (NISTIR 6556, 2000) nvlpubs.nist.gov
- Saitama University, Faculty of Engineering, Department of Mechanical Engineering, practical training — Machining center program 2019 (training NC program O19-0101, with comments) jisshu.mech.saitama-u.ac.jp