
axismd.ai
FANUC Controller
Program/G-code · Intermediate · 5-30 minutes
Fanuc 298 - Figure copy stack overflow
Alarm 298 FIGURE COPY STACK OVERFLOW occurs when the nested depth of figure copy commands (like macro calls, subprogram calls, or parametric programming loops) exceeds the control's stack memory limit. This typically happens when using recursive calls, excessive nesting levels of M98/M99 subprograms, or deeply nested macro calls within the part program. The Fanuc control has a finite stack capacity for tracking nested program execution levels.
Fanuc 298 - Figure copy stack overflow
FIGURE COPY STACK OVERFLOW
Fanuc PS program alarm 298: FIGURE COPY STACK OVERFLOW. This alarm is triggered by an illegal or incorrectly formatted command in the part program, or a programming condition that the Fanuc control cannot execute.
Root Cause Summary
Alarm 298 FIGURE COPY STACK OVERFLOW occurs when the nested depth of figure copy commands (like macro calls, subprogram calls, or parametric programming loops) exceeds the control's stack memory limit. This typically happens when using recursive calls, excessive nesting levels of M98/M99 subprograms, or deeply nested macro calls within the part program. The Fanuc control has a finite stack capacity for tracking nested program execution levels.
Safety
Causes and Fixes
Review the main program and identify all M98 subprogram call sequences. Count the maximum nesting depth (subprograms calling other subprograms).
Check control parameter documentation for maximum allowed nesting levels (typically 4 levels on older controls, 8+ on newer models).
Restructure the program to reduce nesting depth by consolidating subprograms or using sequential calls instead of nested calls.
Back up all programs before modification
Test modified program in single block mode to verify alarm is cleared and machining sequence is correct.
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.