
axismd.ai
FANUC Controller
Program/G-code · Basic · 10-20 minutes
Fanuc Alarm 123 - Variable Not Set
Alarm 123 occurs when a macro program attempts to read or use a macro variable that has not been assigned a value. This typically happens when variables are referenced before initialization, when variable numbers are incorrectly specified, or when logic errors cause the program to skip variable assignment steps.
Fanuc Alarm 123 - Variable Not Set
Macro Variable Undefined
Macro execution alarm: Macro Variable Undefined. An error occurred during custom macro program execution.
Root Cause Summary
Alarm 123 occurs when a macro program attempts to read or use a macro variable that has not been assigned a value. This typically happens when variables are referenced before initialization, when variable numbers are incorrectly specified, or when logic errors cause the program to skip variable assignment steps.
Safety
Causes and Fixes
Identify the exact line number in the alarm message and locate it in the macro program (O-number displayed with alarm).
Check which variable is being referenced at that line (e.g., #100, #500, #1000) and trace backward through the program logic.
Verify if the variable is assigned a value before this line. Add initialization (e.g., #100=0) at the program start or before first use.
Test the corrected program in single block mode to confirm the variable now has a value before being referenced.
Always backup the original macro program before making modifications.
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.