
axismd.ai
FANUC Controller
Program/G-code · Intermediate · 5-30 minutes
Fanuc 107 - Undefined macro variable
Alarm 107 occurs when the CNC program attempts to read or use a macro variable that has not been assigned a value. This is most commonly caused by referencing an empty variable in calculations, conditional statements, or as a parameter before it has been initialized with a value.
Fanuc 107 - Undefined macro variable
UNDEFINED MACRO VARIABLE
Fanuc PS program alarm 107: UNDEFINED MACRO VARIABLE. 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 107 occurs when the CNC program attempts to read or use a macro variable that has not been assigned a value. This is most commonly caused by referencing an empty variable in calculations, conditional statements, or as a parameter before it has been initialized with a value.
Safety
Causes and Fixes
Identify the line number where the alarm occurred by checking the alarm screen or program stop position.
Review the macro variable numbers being used in that line and surrounding blocks (look for # symbols followed by numbers).
Trace back through the program to verify each variable is assigned a value (e.g., #100=50) before it is used in calculations or addresses.
Add initialization statements at the program start or before first use (e.g., #100=0) or verify the variable should have been set by a previous operation.
Ensure initialized values are appropriate for the machining operation to avoid crashes or incorrect tool movements.
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.