FANUC codes
FANUCProgram/G-codeIntermediate15-30 minutes

PS051

Fanuc Alarm PS051 - Subprogram Nesting Exceeded

MISSING MOVE AFTER CNR/CHF

Fanuc PS051: A chamfering or corner rounding command (CHF/CNR) was programmed but the following block does not contain a linear or circular move. A move command must follow CHF/CNR.

Root Cause Summary

Fanuc PS051 alarm occurs when subprogram call nesting exceeds the system's maximum allowable depth, typically 4 levels on older controls (0i/16i/18i) and up to 15 levels on newer systems (30i/31i/32i). This is caused by excessive M98 subprogram calls within subprograms, recursive calling patterns, or incorrect program structure that creates deeper nesting than the control parameter allows.

Safety

  • Check program logic for loops

Causes and Fixes

  1. 1

    Review the active part program structure and trace all M98 subprogram calls. Count the maximum nesting depth from main program through each subprogram level (Main > O1000 > O2000 > O3000 = 3 levels).

  2. 2

    Check parameter 3107 (Subprogram Nesting Level) in SYSTEM > PARAM > search [#3107]. Note the maximum allowable nesting value. On 0i/16i series this is typically fixed at 4 levels; on 30i/31i/32i it may be adjustable.

  3. 3

    Restructure the part program to reduce nesting depth by consolidating subprograms, eliminating unnecessary intermediate subprogram calls, or using macro variables (G65) with local subprograms instead of deeply nested M98 calls.

  4. 4

    Test the modified program in single block mode (SINGLE BLOCK key ON) while monitoring the program stack in CURRENT screen > PROGRAM > STATUS to verify nesting depth remains within limits.

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.