FANUC codes
FANUCProgram/G-codeIntermediate15-45 minutes

120

Fanuc Alarm 120 - Custom Macro Error

Macro Alarm

Fanuc program alarm 120: Macro Alarm. The part program contains an error or illegal condition that the Fanuc control cannot execute. Correct the program to clear this alarm.

Root Cause Summary

Alarm 120 is triggered when the custom macro program (G65/G66 or macro variables) contains a syntax error, undefined variable operation, mathematical error, or illegal macro statement. This is a programmatic issue rather than a hardware fault, indicating the control detected an instruction it cannot process within the macro code.

Safety

  • Macro stopped

Causes and Fixes

  1. 1

    Review the program line number shown with the alarm. Examine all macro variable calculations (#i=#j+#k, #i=#j/#k, etc.) near this line.

  2. 2

    Check for division operations where the divisor variable could equal zero. Verify conditional logic prevents this condition.

  3. 3

    Verify SQRT operations have non-negative inputs and that all referenced macro variables (#100-#999, #1-#33) have been assigned values before use.

  4. 4

    Use MDI mode to manually check suspect variable values. Execute #3000=100 (common variable display) to verify current values before re-running program.

    Avoid modifying macro variables used by machine builder or probe cycles (#500-#699 range often reserved).

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.