Skip to content

G54.1: work offsets beyond G59

G54.1 followed by a P selects one of the extended work offsets, the ones beyond the classic six, G54 to G59. You use them when the table holds many parts or many setups and six zeros fall short: a nest plate, a production fixture, a rotary indexer with several faces. The number of extended offsets available depends on the control and on the option purchased, which on the most common machines reaches forty-eight or three hundred, so that number is the first thing to confirm in your machine's manual.

For reference only: syntax changes with the control, the post-processor and the machine parameters. Check the official manual and run a simulation before cutting. Legal notice.

The brands and control names mentioned belong to their owners and are used only to identify the equipment. GetGCode is not affiliated with or endorsed by any manufacturer, ISO or ASME: this is our own content, not official documentation. Legal notice.

Family
Datums
Machine
Milling, Turning, Mill-turn
Risk
High
Example
G54.1 P12

Syntax by control

Fanuc
G54.1 P12
P identifies the extended offset. P1 is the first of the extended series and has nothing to do with G54: they are separate tables. If the P you ask for is outside the installed range, the control alarms.
Fanuc (writing from the program with G10)
G10 L20 P12 X-250. Y-180. Z-320.
L20 is the code for the extended offset table, whereas L2 writes G54 to G59. This is how you load the zeros of a fixture from the program itself or from a probing routine.
Haas
G154 P12
Haas does the same thing with G154 and a P, normally from 1 to 99 depending on the model. A Fanuc program with G54.1 won't run as is on a Haas: the code has to be translated, even though the idea is identical.
Siemens 840D / 828D
G505 to G599 depending on configuration
Siemens extends the offsets with G505 and up, and the number available is set in a machine data item. They can also be handled by name with the frames in the zero offset list.
Heidenhain TNC
CYCL DEF 247 FIJAR ORIGEN or preset table
Heidenhain works with a preset table with as many rows as you need, and cycle 247 selects one of them. The philosophy is the same as with extended offsets, but without numbered codes.

Address letters used with it

LetterWhat it setsUnit
PNumber of the extended offset within its table. The valid range depends on the installed option; outside that range the control alarms instead of taking a default value.integer, no units
L20 (with G10)Selects the extended offset table when writing from the program. L2 writes G54-G59 and L20 the extended ones: mix them up and you change the zero of another part.integer, no units
X Y Z (with G10)Offset values, measured from machine zero and normally negative on a mill. With G90 they are written as absolute values and with G91 they add to the value already there.mm / in
G54-G59The six classic offsets. They belong to the same modal group as G54.1, so calling one cancels the other.modal, no units

Worked example

Nest plate with twelve small parts clamped on the table of a vertical machining center. Each nest has its zero stored in an extended offset, P1 through P12, and the machining of one part is written just once in a subprogram. The main program only changes the offset and calls the subprogram twelve times.

O0405 (PLACA DE DOCE NIDOS CON G54.1)
( Program header. )
G21 G17 G40 G49 G80 G69
( Clean state: units, plane, no compensation, no cycle and no rotation. )
G91 G28 Z0.
( Z to the reference point before the tool change. )
T1 M06
( First tool in the process. )
G90 G54.1 P1 G00 X0. Y0.
( Selects extended offset number 1, the one for the first nest, and positions over its zero. )
G43 H01 Z50. M03 S4000
( T1 length offset and spindle on. Z50 is already relative to the zero of that nest. )
M08
( Coolant on. )
M98 P2000
( Subprogram with the machining of one part, written in the nest's local coordinates. It must end retracted before moving to the next nest, because the following G54.1 comes with no move. )
G54.1 P2
( Changes to the second nest. Everything that follows refers to its zero. )
M98 P2000
( Same part, second nest. )
G54.1 P3
( Third nest. )
M98 P2000
( Third part. )
(SE REPITE HASTA P12)
( The pattern repeats up to nest twelve. With macros it can be written as a loop instead of by hand. )
G54.1 P12
( Last nest. )
M98 P2000
( Twelfth part. )
G00 Z50. M09
( Retract and coolant off. )
G91 G28 Z0. M05
( Z to the reference point and spindle stop. )
G90 G54 M30
( Goes back to the G54 offset before ending, so the next part doesn't start with nest twelve active. )
Open the simulator to check the example

Practical keys to using G54.1 in the workshop

When it pays to move to extended offsets

With two or three setups, G54 to G59 are more than enough. Extended offsets start to make sense when the table carries a nest plate, when you run several production vises or when an indexer forces you to have one zero per face. The advantage is not just the quantity: since each nest has its fixed number, the program becomes readable, and resetting after a batch change comes down to probing the zeros again, without touching a single line. The drawback is that the list is long and has to be kept documented, or nobody knows what is in P37.

Loading the zeros with G10 and with a probe

Typing twelve or forty offsets into the table by hand is slow and invites keying errors. What production shops do is measure the first one, calculate the rest from the known pitch of the fixture and load them with G10 L20 from a program, or simply probe each nest with a measuring cycle that writes the result to the table. That second route is the right one when the fixture isn't perfect, which is almost always. It is also worth keeping a copy of the table outside the machine: if the memory is lost, recovering it costs a full working day.

Compatibility between machines is the weak point

G54.1 is Fanuc language; Haas does the same with G154, Siemens with G505 and up, and Heidenhain with its preset table. A program that uses extended offsets doesn't move between machines of different brands without translating the code and reloading the table. That is why, in shops with mixed machines, many programmers prefer to keep the nest number in a variable and resolve the call in a routine that is specific to each machine, so that the part program stays clean.

Mistakes that cost you a part (or a tool)

  • Assuming G54.1 P1 is the same as G54: they are separate tables, and the extended P1 is usually at zero if nobody has loaded it.
  • Asking for a P outside the range installed on the machine: the control alarms, and that is the best thing that can happen.
  • Using G10 L2 instead of L20 when loading the zeros: you write G54-G59 and overwrite the offsets of another part.
  • Ending the program with an extended offset active: the next part starts from the zero of the last nest.
  • Copying a program with G54.1 to a Haas without translating it to G154: the control gives an unknown code alarm.
  • Not documenting which nest each P is: after a few months nobody knows what is loaded in half the table.
  • Loading zeros calculated from the print into a fixture that isn't perfect, instead of probing each nest.

Frequently asked questions

How many extended offsets does my machine have?

It depends on the option purchased. The most common configurations offer forty-eight or three hundred, but you can't take that for granted: check it on the control's options screen or in the machine manual.

Are G54.1 P1 and G54 the same offset?

No. They are two independent tables: the classic six on one side and the extended ones on the other. The extended P1 holds whatever value someone loaded into it, which by default is zero, that is, machine zero.

How do I load the values from the program?

With G10 L20 P followed by the offset number and the X, Y and Z values measured from machine zero. In G90 it replaces the value and in G91 it adds to what was there, which is what you use to apply a fine correction.

What is the equivalent of G54.1 on a Haas?

G154 with its P. The idea is the same but the code isn't, so the program has to be translated. On Siemens the equivalent is G505 and up, and on Heidenhain the preset table with cycle 247.

Can I combine G54.1 with G52 or with a rotation?

Yes. The extended offset acts as the base and the local shift and rotation apply on top of it, just as with G54. What you have to watch is canceling the local shift when you finish each nest, or the next one drags it along.

Related codes

Other codes in Datums

See the full list of G and M codes

Related apps