Home › M-codes › Mach3 Mach4 › M6
M6 Tool change
Mach3 Mach4 M-code · Mill
Runs the tool change macro for the tool named by T. Mach3 runs M6Start, waits for Cycle Start, then runs M6End. Mach4 runs the m6 Lua script in the profile Macros folder.
Format
T M6
Addresses
| Address | What it does |
|---|---|
T | Tool number, on the same line or earlier |
How it works
Non modal.
Example program
G0 G20 G90 G54 G17 G40 G49 G80 (SAFE START, INCH)
M5 M9 (SPINDLE AND COOLANT OFF)
G53 G0 Z0 (Z UP BEFORE CHANGE)
T2 M6 (CHANGE TO TOOL 2)
…
M5 M9 (SPINDLE AND COOLANT OFF)
G53 G0 Z0 (Z UP BEFORE CHANGE)
T2 M6 (CHANGE TO TOOL 2)
…
The full 6-line example is in the app. Example is in inch. Check offsets and clearances first.
Watch out for
- Mach3 tool change can be set to be ignored on the Config menu, Logic page. Then M6 does nothing and the wrong tool cuts.
- The stock macros do not move the machine. Add your own move to a change spot, such as G53 Z0, in the script or the program.
- T and M6 do not apply the length. Follow with G43 H.
Related codes
M6 on other controls
The same number can mean something different on another control.
| Control | Meaning |
|---|---|
| Fanuc | Tool change |
| Haas NGC | Tool change |
| Doosan (Fanuc) | Atc tool change command |
| DMG Mori MAPPS (Fanuc) | Tool change |
| Mazak (EIA) | Chuck unclamp (releasing workpiece) |
| Okuma OSP | Tool Change |
| Mitsubishi M70 M80 | Tool change |
| Brother Speedio | Tool change |
| Siemens 840D 828D | Tool change |
| Heidenhain TNC (ISO) | Tool change |
| Fagor 8055 8065 | Tool change |
| LinuxCNC Tormach | Tool change |
| Centroid CNC12 Acorn | Tool change |
| Hurco WinMax (NC) | Tool change |
| Fadal | Tool change |
| Swiss (Citizen Star) | Main chuck close (Citizen) |
Every M-code for Mach3 Mach4 in your pocket. The app has the full example programs, search by number or shop word, a line decoder and calculators for tapping, threading and drilling.
Open M6 in the app All Mach3 Mach4 M-codes