FANUC codes
FANUCProgram/G-codeIntermediate15-30 minutes

121

Fanuc Alarm 121 - Variable Overflow

Macro Variable Overflow

Macro execution alarm: Macro Variable Overflow. An error occurred during custom macro program execution.

Root Cause Summary

Alarm 121 occurs when a macro variable calculation results in a value that exceeds the permissible range (-9999999999.99999 to +9999999999.99999) or when an illegal mathematical operation is attempted during macro execution. This is typically caused by arithmetic overflow, division errors, or improper variable assignments in custom macro programs.

Safety

  • Math overflow

Causes and Fixes

  1. 1

    Identify the exact line in the macro program where the alarm occurred by checking the program position on the control display.

  2. 2

    Review the mathematical operations on that line and trace back the values of all variables involved using MDI mode to check their current values (#500-#999 range).

  3. 3

    Add intermediate calculation steps to break down large calculations, or implement range checking with IF statements before performing operations (e.g., IF[#100 LT 10000] THEN #110=#100*#100).

  4. 4

    Test the modified macro with known safe values first, then gradually increase to production values while monitoring variable values.

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.