Home › G-codes › Haas NGC › G21
G21 Metric programming check / Select metric
Haas NGC G-code · Mill, Lathe
On mills: Metric programming check
Tells the control the program is in millimeters. Setting 9 must be set to metric for the program to run.
Format
G21
How it works
Modal, units group 06.
Example program
O01001 (METRIC PROGRAM)
G21 (CONFIRM METRIC MODE)
G17 G40 G80 G90 (SAFE START)
G21 (CONFIRM METRIC MODE)
G17 G40 G80 G90 (SAFE START)
Example is in inch. Check offsets and clearances first.
Watch out for
- A G21 program will not run in inch mode. Change Setting 9 first.
- Feeds and offsets change meaning with units. Check them after switching.
On lathes: Select metric
Confirms the program is in metric. Use Setting 9 to choose inch or metric. G21 alarms if Setting 9 is not set to metric.
Format
G21
How it works
Modal, group 06.
Example program
G00 G18 G21 G40 G80 G99 (SAFE STARTUP, METRIC)
T0101 (OD TOOL)
G00 G54 X52. Z2.5 (APPROACH, VALUES IN MM)
T0101 (OD TOOL)
G00 G54 X52. Z2.5 (APPROACH, VALUES IN MM)
Example is in inch. Check offsets and clearances first.
Watch out for
- G21 does not switch the units on a Haas. It checks them. Set Setting 9 to MM first.
Related codes
G21 on other controls
The same number can mean something different on another control.
| Control | Meaning |
|---|---|
| Fanuc | Metric input |
| Mazak (EIA) | Metric input |
| Okuma OSP | Metric input confirmation |
| Mitsubishi M70 M80 | Metric input |
| Brother Speedio | Metric input |
| LinuxCNC Tormach | Millimeter units |
| Mach3 Mach4 | Metric units |
| Centroid CNC12 Acorn | Metric units |
| Hurco WinMax (NC) | Metric input (ISNC) |
| Fadal | Check for metric setting |
| Swiss (Citizen Star) | Metric input |
Every G-code for Haas NGC 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 G21 in the app All Haas NGC G-codes