FANUC codes
FANUCProgram/G-codeIntermediate15-30 minutes

031

Fanuc Alarm 031 - ILLEGAL P COMMAND IN G10

FANUC ALARM 31

Data input for the L number of G10 or the corresponding function is not enabled. A data setting address such as P or R is not specified, or is out of range.

Root Cause Summary

Fanuc Alarm 031 occurs when a G10 programmable data setting command is issued with an invalid, missing, or out-of-range address specification (typically P, R, or Q) for the selected L-code function. This alarm also triggers when the corresponding parameter that enables the L-code function is not set correctly, preventing the system from accepting the data input command.

Causes and Fixes

  1. 1

    Review the active G10 block in the program at the alarm point. Check the exact G10 L-code being used (L2 for work offset, L10/L11 for tool offset, L20 for additional work offset, etc.).

  2. 2

    Verify the P address value is within valid range: For G10 L2, P must be 1-6 (G54-G59) or extended range if parameter 1220 bit 5 (EWZ) is enabled (P1-300+). For G10 L10/L11, P must match valid tool number range per parameter 6800 (maximum tool number).

  3. 3

    Check that all required addresses for the L-code are present. Example: G10 L2 P_ X_ Y_ Z_ requires P to specify work offset number. If using R address (G10 L20), verify parameter 6004#1 (R designation) is set to 1.

  4. 4

    Correct the program syntax with valid address and value. Example: Change 'G10 L2 X100.0 Y50.0' to 'G10 L2 P1 X100.0 Y50.0' to specify G54 work offset.

DIY Feasiblehigh confidence

Call a technician if:

  • ·Parameter changes require machine builder approval
  • ·G10 function needs to be enabled but safety concerns exist
  • ·Macro option installation required

Prevention

  • Always verify P address ranges before programming G10 commands
  • Use OFFSET display to confirm valid offset numbers
  • Test G10 commands in single block mode first
  • Document which G10 functions are enabled on each machine

Common Mistakes

  • Using P0 with L codes that don't support it
  • Forgetting to enable parameter 3202 bits
  • Mixing up coordinate system numbers (P1=G54, not G53)
  • Using tool numbers beyond parameter 6001 limit

Related Alarms

Seeing Multiple Alarms?

Seeing another alarm with this one? Enter the code.

Get machine-aware diagnosis

AxisMD logs alarms against your actual machines, tracks patterns, and gives AI context your manual doesn't have.

Start free

Was this guide helpful?

Always verify with your machine manual or a certified technician before performing service procedures.