Skip to content

G154 on Haas: the extended work offsets

G154 followed by a P selects one of the extended work offsets on Haas controls, the ones beyond the classic six, G54 to G59. They are the answer when the table carries a nest plate, several production vises or a fixture with many positions: each setup has its own numbered zero and the program switches from one to the next with a single line. The number of offsets available depends on the model and the software version, so that is the first thing to check 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
Haas manufacturer
Machine
Milling, Turning, Mill-turn
Risk
High
Example
G154 P10

Syntax by control

Haas (selection)
G154 P12
P identifies the extended offset. It belongs to the same modal group as G54 to G59, so calling one cancels the other. If you ask for a P outside the available range, the control alarms.
Haas (writing from the program)
G10 L20 P.. X.. Y.. Z.. per the manual
The offsets can be loaded with G10 from the program itself: L2 is for G54-G59 and the extended offsets use L20. How the P number in G10 maps to the one in G154 depends on the software version: look it up in the manual before writing to the table blind.
Haas (correcting from the screen)
Offsets screen, work offsets tab
The usual way to load them is by probing or touching off with the tool and saving the value from the screen, same as with G54. The extended offsets appear in the same table, further down.
Fanuc (equivalent)
G54.1 P12
Fanuc does the same thing with G54.1 and its P. A Haas program with G154 won't run as is on a Fanuc: the code has to be translated, even though the idea is identical.
Siemens (equivalent)
G505 and up
Siemens extends the offsets with G505 and up, and the number available is set in machine data.

Address letters used with it

LetterWhat it setsUnit
PNumber of the extended offset. The valid range depends on the model and the software version; outside it, the control alarms instead of taking a default value.integer, no units
X Y ZOffset values in the table, measured from machine zero. On a vertical mill they are usually negative.mm / in
G54-G59The six classic offsets, in the same modal group. Calling one of them cancels any active extended offset.modal, no units
G52Local shift that adds to the active offset, classic or extended. It is what you use to move the zero within a nest without touching the table.mm / in

Worked example

Production fixture with six identical vises on the table of a Haas machining center. Each vise has its zero loaded in an extended offset, P1 through P6, and the part is machined with a subprogram written in local coordinates. That way, if a vise moves out of position, you only re-probe that offset and don't touch a single line of the program.

O0418 (SEIS MORDAZAS CON G154)
( Program header. )
G17 G40 G49 G80
( XY plane and a clean state: no compensation or cycles active. )
G21
( Millimeters. On Haas the units are set by Setting 9: G20 and G21 do not change them and only alarm if they do not match it. )
G91 G28 Z0.
( Z to the reference point before the change. )
T1 M06
( First tool in the process. )
G90 G154 P1 G00 X0. Y0.
( Selects extended offset 1, the one for the first vise, and positions over its zero. )
G43 H01 Z50. M03 S4000
( T1 length offset and spindle on. Z is already relative to the zero of that vise. )
M08
( Coolant on. )
M98 P4000
( Subprogram with the machining of one part, written in local coordinates. It must end retracted before moving to the next station, because the following G154 comes with no move. )
G154 P2
( Second vise. Everything that follows refers to its zero. )
M98 P4000
( Same part, second position. )
G154 P3
( Third vise. )
M98 P4000
( Third part. )
G154 P4
( Fourth vise. )
M98 P4000
( Fourth part. )
G154 P5
( Fifth vise. )
M98 P4000
( Fifth part. )
G154 P6
( Sixth vise. )
M98 P4000
( Sixth 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 the sixth vise active. )
Open the simulator to check the example

Practical keys to using Haas G154 in the workshop

When to make the jump to extended offsets

With one or two setups, the six classic offsets are more than enough. Extended offsets start to become necessary when the table fills up: a plate with several parts, a production fixture with fixed positions, an indexer with several zeros. The advantage is not just the quantity, it is that each position has a stable number and the program stays readable. In exchange, you have to keep the list documented: without a sheet that says what each P is, after a few months nobody knows what is loaded in half the table and you end up probing everything again.

Loading and correcting the zeros without drama

On a real fixture, the positions are never exactly where the print says. That is why what works is probing each nest instead of calculating them all from the first one, even if it is slower the first time. If the machine has a probe, a measuring cycle can load the whole table without intervention. And when a part comes out shifted in only one position, the fix is a touch-up to that offset, never a change to the program. It is also worth keeping a copy of the table outside the machine: rebuilding it from scratch costs a full working day.

Combining with G52 and subprograms

The pattern that makes all this useful is writing the part just once, in local coordinates, and calling it from the main program while changing the offset. If you need to move to sub-positions within each position, G52 adds the local shift on top of the extended offset and is canceled at the end of each one. What you don't want is to mix levels with no plan: a program with extended offsets, local shifts and rotations all active at once is very hard to debug when something comes out shifted.

Mistakes that cost you a part (or a tool)

  • Asking for a P outside the range available on your model: the control alarms, and that is the best thing that can happen.
  • Ending the program with an extended offset active: the next part starts from the zero of the last position.
  • Calculating all the zeros from the first one instead of probing them: a real fixture is never perfect.
  • Copying a Haas program with G154 to a Fanuc without translating it to G54.1: the control gives an unknown code alarm.
  • Not documenting which setup each P is, so the table becomes unreadable after a few months.
  • Assuming how the P in G10 maps to the P in G154 without looking at the manual for your software version.
  • Not keeping a copy of the offset table outside the machine.

Frequently asked questions

How many extended offsets does my Haas have?

It depends on the model and the software version. Check the offsets screen, where they are listed, or the operator's manual. It is best not to take any specific number for granted.

Is G154 P1 the same as G54?

No. They are separate entries in the offset table: 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.

How do I load the values?

Same as G54: by probing or touching off with the tool and saving the value from the offsets screen, where the extended offsets appear in the same table. They can also be written from the program with G10, after checking in the manual how the P numbers map.

What is the equivalent of G154 on Fanuc?

G54.1 with its P. The idea is the same but the code isn't, so a program that uses extended offsets has to be translated when you change control brands.

Can I use G52 on top of an extended offset?

Yes, the local shift adds to the active offset whatever its type. What matters is canceling it at the end of each position, or the shift carries over to the next one.

Related codes

G54.1G54-G59G10G52/G92M98/M99

Other codes in Haas manufacturer

See the full list of G and M codes

Related apps