G-CODEEIA/ISO · modal · group 06
G21
Metric data input
Machine-specific. This G-code reference is specific to the Mazak INTEGREX e-670H / e-670H-S with the MAZATROL SmoothX control (EIA/ISO programming manual H747PB0030E). G-code availability depends on fitted options, and groups and behaviour differ between Mazak models and control generations — verify against the manual for your own machine before programming with any code.
What it does
Inch command/metric command selection is possible with G-code commands. The decimal point can be used to determin the units digit (mm or inch) of dimensional data or feed rate.
G21 is modal (group 06) — it stays in effect until another code of the same group replaces it.
Initial state: a parameter can select G21 as the initial modal condition — what your machine wakes up in depends on that setting.
Programming format
G21 G20 G21 G20
Address words
- G20: Inch command selection
- G21: Metric command selection
- . Metric system
- . Inch system
Notes & precautions
- Do not fail to give an F command appropriate to the new unit system after
Source
Mazak PROGRAMMING MANUAL for EIA/ISO PROGRAM, manual H747PB0030E, section 5-2 Inch/Metric Selection: G20/G21, p. 3-11, 5-3, 5-4. Reference and explanation only — not a reproduction of the manual.