CNC mill · G-code

G54–G59: work coordinate systems

G54 to G59 pick one of six work offsets, so X0 Y0 Z0 in the program is where the part is set up, not machine zero. Haas lists it in modal group 12. Formats below from Haas, LinuxCNC and Mach4, each from its maker.

Worked example

Two vises, two offsets. Written for this page in the Haas format.

G00 G90 G54 X0 Y0 (part in the left vise)(… machine part 1 …)G00 Z1.G55 X0 Y0 (same program, right vise)

How each control writes it

Haas G54 … G59

One source: Haas Automation, the control's maker

  • All later axis positions are read in the selected system.
  • G154 P1–P99 selects more work offsets.

Source: Haas Automation, mill G54

LinuxCNC G54 … G59, G59.1, G59.2, G59.3

One source: the LinuxCNC project, the control's maker

  • Nine systems: G59.1 to G59.3 are systems 7 to 9.
  • Each stores X–W and an XY rotation in numbered parameters (G54 from 5221).

Source: LinuxCNC documentation, "G54-G59.3 Select Coordinate System" (archived Oct 29, 2026)

Mach4 G54 … G59, G54.1 P1–P248

One source: Artsoft (Newfangled Solutions), the control's maker

P
With G54.1: which of the 248 additional fixture offsets (optional)
  • The offset stays active until another is called or the control is reset.
  • Older Mach versions used G59 P7, P8 …: G59 P7 is G54.1 P1, and those still work.

Source: Mach4 Mill Programming Guide v1.1 (Artsoft), "G54-G59 Fixture Offset; G54.1 Additional Fixture Offsets" (archived Jul 1, 2024)

How the controls differ

  • Only Mach4 takes P.
  • A word two controls share can still mean different things: read each control's list above.

No Fanuc row yet: that chapter of the 0i manual has not been read.

Haas follows Fanuc's numbering, but options and parameters differ between controls: check your control's manual.