CNC Machinist Calculator Ultra

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)

Example is in inch. Check offsets and clearances first.

Watch out for

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)

Example is in inch. Check offsets and clearances first.

Watch out for

Related codes

G20

G21 on other controls

The same number can mean something different on another control.

ControlMeaning
FanucMetric input
Mazak (EIA)Metric input
Okuma OSPMetric input confirmation
Mitsubishi M70 M80Metric input
Brother SpeedioMetric input
LinuxCNC TormachMillimeter units
Mach3 Mach4Metric units
Centroid CNC12 AcornMetric units
Hurco WinMax (NC)Metric input (ISNC)
FadalCheck 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

App Store Google Play