Home › G-codes › Mach3 Mach4 › G20
G20 Inch units
Mach3 Mach4 G-code · Mill
Program values are read in inches. It does not change the configured native units of the machine.
Format
G20
Addresses
| Address | What it does |
|---|---|
G20 | No address words |
How it works
Modal, units group.
Example program
G0 G20 G90 G54 G17 G40 G49 G80 (INCH SAFE START)
T1 M6 (TOOL CHANGE)
S5000 M3 (SPINDLE ON)
G43 H1 Z1.0 (LENGTH OFFSET)
…
T1 M6 (TOOL CHANGE)
S5000 M3 (SPINDLE ON)
G43 H1 Z1.0 (LENGTH OFFSET)
…
The full 5-line example is in the app. Example is in inch. Check offsets and clearances first.
Watch out for
- Program G20 or G21 once at the top, before any motion, and do not switch mid program.
- Mach3 also accepts G70 and G71 for inch and metric. Those are not the Fanuc lathe cycles.
- Units in Motor Tuning and offsets are separate from G20 and G21. Check the DRO units on the screen.
Related codes
G20 on other controls
The same number can mean something different on another control.
| Control | Meaning |
|---|---|
| Fanuc | Inch input |
| Haas NGC | Inch programming check |
| Mazak (EIA) | Inch input |
| Okuma OSP | Inch input confirmation |
| Mitsubishi M70 M80 | Inch input |
| Brother Speedio | Inch input |
| Fagor 8055 8065 | Lower work zone limits (8055) |
| LinuxCNC Tormach | Inch units |
| Centroid CNC12 Acorn | Inch units |
| Hurco WinMax (NC) | Inch input (ISNC) |
| Fadal | Check for inch setting |
| Swiss (Citizen Star) | Inch input |
Every G-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 G20 in the app All Mach3 Mach4 G-codes