
axismd.ai
FANUC Controller
Program/G-code · Intermediate · 15-30 minutes
Fanuc Alarm 031 - ILLEGAL P COMMAND IN G10
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.
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
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.).
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).
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.
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.
Call a technician if:
Prevention
Common Mistakes
Seeing Multiple Alarms?
Seeing another alarm with this one? Enter the code.
AxisMD logs alarms against your actual machines, tracks patterns, and gives AI context your manual doesn't have.
Start freeWas this guide helpful?
Always verify with your machine manual or a certified technician before performing service procedures.