122
G Codes
96-8000 rev R June 2007
G18
G19
X
X
Y
Y
Z
Z
G17
G20 Select Inches / G21 Select Metric (Group 06)
The G codes G20 (inch) and G21 (mm) codes are used to ensure that the inch/metric selection is set correctly for
the program. Selection between inch and metric programming should be done using Setting 9.
G28 Return to Machine Zero Thru Optional G29 Reference Point (Group 00)
The G28 code is used to return all axes to machine zero, unless an axis (or axes) is specified, in which case only
that axis (or axes) is returned to machine zero. G28 cancels tool length offsets for the following lines of code.
Spindle
G00 G28 G91 Z0
Rapid Return
To “Z” Zero
Machine Table
Example 1
Work Offset G54: Z = 2.0
Tool 2 Length: 12.0
Program segment:
G90 G54;
G43 H02;
G28 Z0.;
G00 Z1.
The G28 block will move to machine coordinate Z = 14.0 before moving to Z = 0. The following block (G00 Z1.) will
move to machine coordinate Z = 1.
Example 2
(same work and tool offsets as Example 1)
Program segment:
G54;
G43 H02;
G00 G91G28 Z0
The G28 block will move directly to machine coordinate Z = 0 since incremental positioning is in effect.