Pro codes · Fanuc

#5201–#5326 — Work offset variables (Fanuc)

Work offset variables. Work offsets as variables: #5201–#5206 external (common) offset, #5221–#5226 G54, #5241 G55, #5261 G56, #5281 G57, #5301 G58, #5321 G59 (X, Y, Z, 4th … in order)…

By cnccode · Updated
On this page
  1. What it does
  2. Example
  3. Tips
  4. More: macro and system variables
  5. Frequently asked questions
PropertyValue
Code#5201–#5326
ControlFanuc
TopicMacro and system variables
SyntaxG54: #5221 X, #5222 Y, #5223 Z · G55: #5241 · … · G59: #5321

What it does

Work offsets as variables: #5201–#5206 external (common) offset, #5221–#5226 G54, #5241 G55, #5261 G56, #5281 G57, #5301 G58, #5321 G59 (X, Y, Z, 4th … in order). Reading them is safe; writing them changes the offset like G10.

Example

Fanuc
#5221 = #5221 + 0.02 (SHIFT G54 X BY 0.02)
#5242 = #5222        (COPY G54 Y TO G55 Y)

Tips

  • Extended offsets G54.1 P1–P48 use #7001 onwards (20 numbers per offset).

Careful: Writing offsets in a loop with a typo can move every part. Test the macro in single block.

Options, numbers and parameters depend on the control model, the software version and the options the machine builder installed. Check the operator and parameter manual of your machine before you use a code for the first time, and run it in single block with low overrides.

Try it without a machine

The Macro B simulator runs variables, G65 calls, #3000 alarms, G10 and system variables block by block.

Open the Macro B simulator

More: macro and system variables

Frequently asked questions

What is #5201–#5326 on Fanuc?
Work offset variables. Work offsets as variables: #5201–#5206 external (common) offset, #5221–#5226 G54, #5241 G55, #5261 G56, #5281 G57, #5301 G58, #5321 G59 (X, Y, Z, 4th … in order). Reading them is safe; writing them changes the offset like G10.
Was this page helpful?