Home › G-codes › LinuxCNC Tormach › G20
G20 Inch units
LinuxCNC Tormach G-code · Mill and lathe
Sets program units to inches for positions, offsets entered in code and feed rates.
Format
G20
Addresses
| Address | What it does |
|---|---|
none | No words |
How it works
Modal, units group.
Example program
G20 G17 G40 G49 G54 G80 G90 G94 (INCH, SAFE START)
T1 M6 G43
S3000 M3
G0 X1 Y1 Z0.1 (INCH POSITIONS)
T1 M6 G43
S3000 M3
G0 X1 Y1 Z0.1 (INCH POSITIONS)
Example is in inch. Check offsets and clearances first.
Watch out for
- Put G20 or G21 on the first line of every program. The last mode used stays active otherwise.
- Changing units does not change the machine units set in the INI file. LinuxCNC converts.
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) |
| Mach3 Mach4 | 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 LinuxCNC Tormach 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 LinuxCNC Tormach G-codes