FANUC codes
FANUCProgram/G-codeBasic10-20 minutes

123

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

  • Macro cannot continue

Causes and Fixes

  1. 1

    Identify the exact line number in the alarm message and locate it in the macro program (O-number displayed with alarm).

  2. 2

    Check which variable is being referenced at that line (e.g., #100, #500, #1000) and trace backward through the program logic.

  3. 3

    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.

  4. 4

    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.

Service Recommended confidence

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.