
axismd.ai
FANUC Controller
Program/G-code · Intermediate · 15-30 minutes
Fanuc Alarm 125 - DO Loop Nesting Exceeded
Fanuc Alarm 125 MACRO STATEMENT FORMAT ERROR occurs when the CNC detects improper syntax or formatting within a custom macro program (G65/G66 macro call or macro body using #variables). This typically results from incorrect use of macro variable expressions, missing operators, invalid arithmetic statements, or improperly formatted conditional/assignment statements in the macro code.
Fanuc Alarm 125 - DO Loop Nesting Exceeded
Too Many DO Levels
Fanuc program alarm 125: Too Many DO Levels. 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
Fanuc Alarm 125 MACRO STATEMENT FORMAT ERROR occurs when the CNC detects improper syntax or formatting within a custom macro program (G65/G66 macro call or macro body using #variables). This typically results from incorrect use of macro variable expressions, missing operators, invalid arithmetic statements, or improperly formatted conditional/assignment statements in the macro code.
Safety
Causes and Fixes
Review the macro program line indicated in the alarm display. Check PROGRAM screen for the O-number and sequence number where the alarm occurred. Look for the specific N-block or statement causing the error.
Verify all macro variable assignment statements follow correct format: #i=expression (ensure space or proper operator exists between all variables and constants). Check for missing arithmetic operators (+, -, *, /, AND, OR, XOR) between operands.
Confirm all parentheses and brackets are properly paired and nested in arithmetic expressions. Example: #100=[#101+#102]*SIN[#103] must have matching brackets.
Check parameter 6001 (macro variable address display format) to verify macro executor is enabled. If set to 0, custom macro capability may be disabled causing format errors.
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.