FANUC codes
FANUCProgram/G-codeIntermediate5-30 minutes

261

Fanuc 261 - Illegal command in retrace

ILLEGAL COMMAND IN RETRACE

Fanuc PS program alarm 261: ILLEGAL COMMAND IN RETRACE. 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 261 occurs when the CNC control encounters an illegal or improperly formatted G-code command during program retrace (restart) operations. This typically happens when attempting to restart from a mid-program point where the control cannot properly establish machine state due to incompatible commands, missing modal information, or commands that are not allowed during retrace mode.

Safety

  • Verify corrected program or parameters before resuming machining

Causes and Fixes

  1. 1

    Identify the exact block number where retrace was attempted from the alarm history and program display.

  2. 2

    Review the program block and surrounding lines for M-codes (especially M06, M98, M99), G65 macro calls, or custom cycles that are active at the restart point.

  3. 3

    Move the restart point earlier in the program to a safe position before the problematic command, or restart from program beginning (sequence number N0 or block O-number).

    Ensure tool offsets and work coordinate systems are properly established before resuming machining

  4. 4

    If restart must occur at this location, use MDI mode to manually execute necessary preparatory commands, then restart from the next safe block.

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.