M6 is a LinuxCNC M-code that performs a tool change, replacing the tool currently in the spindle with the tool most recently selected by a T word. When the change completes, the spindle is stopped and the selected tool is in the spindle; a tool removed from the spindle is returned to the tool changer magazine if it was not already there. The tool changer itself must be configured in HAL and possibly ClassicLadder for the change to occur.
| Language | gcode |
|---|---|
| Code | M6 |
| Syntax | M6 |
| Dialect | LinuxCNC |