
axismd.ai
FANUC Controller
Program/G-code · Intermediate · 10-20 minutes
Fanuc Alarm 122 - Division by Zero
FANUC Alarm 122 occurs when the custom macro nesting depth exceeds the system limit, typically 4 levels deep for most Fanuc controls. This happens when a macro program calls another macro, which calls another, and so on, exceeding the maximum allowable nesting level defined by the control's macro executor.
Fanuc Alarm 122 - Division by Zero
Macro Division Error
Macro execution alarm: Macro Division Error. An error occurred during custom macro program execution.
Root Cause Summary
FANUC Alarm 122 occurs when the custom macro nesting depth exceeds the system limit, typically 4 levels deep for most Fanuc controls. This happens when a macro program calls another macro, which calls another, and so on, exceeding the maximum allowable nesting level defined by the control's macro executor.
Safety
Causes and Fixes
Review the active macro program structure and count the nesting levels. Check SYSTEM > CURRENT > PROGRAM to identify which O-number macro is currently executing when the alarm occurs.
Examine all G65 macro calls and M98 subprogram calls within the macro program hierarchy. Map out the calling sequence to identify where nesting exceeds 4 levels deep.
Restructure the macro program logic to reduce nesting depth. Combine multiple nested macros into single routines or use sequential calls instead of nested calls where possible.
Backup the original macro programs before modifying. Test restructured macros in single block mode first.
Verify parameter 6071 (macro nesting level limit) if available on your control series. On 30i/31i/32i systems, this parameter may allow adjustment of nesting depth, though standard limit remains 4 levels.
Call a technician if:
Prevention
Common Mistakes
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.