
axismd.ai
FANUC Controller
Program/G-code · Intermediate · 15-30 minutes
Fanuc Alarm 124 - GOTO Nesting Exceeded
Fanuc Alarm 124 MISSING END STATEMENT occurs when a custom macro program contains a DO loop structure that lacks its corresponding END statement. This is a syntax error in macro programming where the DO-END pairing is incomplete, preventing proper program compilation and execution. The alarm is triggered during program execution or background edit/search operations when the control detects unbalanced loop structures.
Fanuc Alarm 124 - GOTO Nesting Exceeded
Too Many GOTO Levels
Fanuc program alarm 124: Too Many GOTO 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 124 MISSING END STATEMENT occurs when a custom macro program contains a DO loop structure that lacks its corresponding END statement. This is a syntax error in macro programming where the DO-END pairing is incomplete, preventing proper program compilation and execution. The alarm is triggered during program execution or background edit/search operations when the control detects unbalanced loop structures.
Safety
Causes and Fixes
Press EDIT mode, search for the program number that was active when alarm occurred. Check alarm history at ALARM > HISTORY screen to identify exact program number.
Search the macro program for all DO statements (DO1, DO2, DO3, etc.). Count each DO instruction and verify each has a corresponding END1, END2, END3 statement matching the DO level number.
Check nested DO loops carefully. Each DO level must have proper END pairing: DO1...END1, DO2...END2, DO3...END3. Maximum nesting is typically DO1 through DO3 depending on control series.
Incorrect nesting order (e.g., DO1-DO2-END1-END2 instead of DO1-DO2-END2-END1) will also trigger this alarm.
Add the missing END statement at the appropriate location in the macro program. Reset alarm with RESET key, verify program syntax by running background edit check (Parameter 3107#3=1 enables background edit), then test macro execution.
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.