
axismd.ai
FANUC Controller
Program/G-code · Intermediate · 5-30 minutes
Fanuc 104 - Illegal variable number
Alarm 104 occurs when the CNC program references a macro variable number that is outside the valid range for the control, or uses an invalid format for variable addressing. This commonly happens with system variables, common variables (#100-#999), or when variable numbers are calculated incorrectly using indirect addressing.
Fanuc 104 - Illegal variable number
ILLEGAL VARIABLE NUMBER
Fanuc PS program alarm 104: ILLEGAL VARIABLE NUMBER. This alarm is triggered by an illegal or incorrectly formatted command in the part program, or a programming condition that the Fanuc control cannot execute.
Root Cause Summary
Alarm 104 occurs when the CNC program references a macro variable number that is outside the valid range for the control, or uses an invalid format for variable addressing. This commonly happens with system variables, common variables (#100-#999), or when variable numbers are calculated incorrectly using indirect addressing.
Safety
Causes and Fixes
Note the program line number where alarm occurred and review the O-number program on the CNC display or using EDIT mode.
Identify all variable references (#xxx) on the alarm line and verify each number is within valid range: #1-#33 local, #100-#199 common saved, #500-#999 common, #1000-#9999 system variables per your control model.
Check for indirect addressing like ##i where variable #i may calculate to zero, negative, or exceeds maximum. Insert a debug line before alarm to display calculated value: #3000=##i (displays on screen).
Correct the variable number to valid range or fix the calculation logic. If using system variables, consult parameter manual section 4 for your specific control series (0i, 30i, 31i, etc.) to verify valid system variable ranges.
System variable ranges differ between control models - using 31i variables on a 0i control will trigger this alarm
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.