FANUC codes
FANUCProgram/G-codeIntermediate5-30 minutes

298

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

  • Verify corrected program or parameters before resuming machining

Causes and Fixes

  1. 1

    Review the main program and identify all M98 subprogram call sequences. Count the maximum nesting depth (subprograms calling other subprograms).

  2. 2

    Check control parameter documentation for maximum allowed nesting levels (typically 4 levels on older controls, 8+ on newer models).

  3. 3

    Restructure the program to reduce nesting depth by consolidating subprograms or using sequential calls instead of nested calls.

    Back up all programs before modification

  4. 4

    Test modified program in single block mode to verify alarm is cleared and machining sequence is correct.

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.