Pro codes · Fanuc

#4001–#4130 — Modal information (Fanuc)

Modal information. Tells a macro which modal codes are active: #4001 group 1 (G00–G03), #4003 G90/G91, #4006 G20/G21, #4014 work offset (54–59), #4107 D, #4109 F, #4111 H, #4119 S, #4120…

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#4001–#4130
ControlFanuc
TopicMacro and system variables
Syntax#4001–#4022 G groups of the previous block · #4102–#4120 B D E F H M N O S T

What it does

Tells a macro which modal codes are active: #4001 group 1 (G00–G03), #4003 G90/G91, #4006 G20/G21, #4014 work offset (54–59), #4107 D, #4109 F, #4111 H, #4119 S, #4120 T. A good macro saves them at the start and restores them at the end, so it does not change the program that called it.

Example

Fanuc
#30 = #4003 (SAVE G90/G91)
G91 G28 Z0
G#30         (RESTORE)

Tips

  • #4201 onwards gives the same for the block being executed on many controls.

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 #4001–#4130 on Fanuc?
Modal information. Tells a macro which modal codes are active: #4001 group 1 (G00–G03), #4003 G90/G91, #4006 G20/G21, #4014 work offset (54–59), #4107 D, #4109 F, #4111 H, #4119 S, #4120 T. A good macro saves them at the start and restores them at the end, so it does not…
Was this page helpful?