FANUC codes
FANUCProgram/G-codeBasic5-15 minutes

038

Fanuc Alarm 038 - Return Without Call

Subprogram Return

Fanuc program alarm 038: Subprogram Return. 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 038 occurs when an M99 (subprogram return) command is executed in the main program without a corresponding M98 (subprogram call) or when M99 is encountered outside of a subprogram context. This is a program logic error where the control expects M99 only within a called subprogram to return control to the calling program.

Safety

  • Program flow error

Causes and Fixes

  1. 1

    Press RESET to clear the alarm. Navigate to EDIT mode and review the current program where the alarm occurred.

  2. 2

    Search for M99 commands in the program using the search function. Verify each M99 is within a subprogram (not the main O-number program being executed).

  3. 3

    If M99 is found in the main program, either remove it or replace it with M30 (program end) or M02 (program end without reset) as appropriate for main program termination.

  4. 4

    If the intent was to create a repeating loop in the main program, use M99 P[line_number] to jump to a specific line, or restructure the program to use proper subprogram calls with M98.

    M99 P___ for looping in main programs may not be supported on all Fanuc control versions. Verify compatibility with parameter 3404 bit 5 (M99 loop enable) if available on your series.

DIY Feasiblehigh confidence

Call a technician if:

  • ·Parameter corruption suspected
  • ·Repeated alarms after geometry corrections
  • ·Tool offset memory errors

Prevention

  • Always verify tool radius vs minimum arc radius before programming
  • Use FANUC program check simulation before first run
  • Implement proper lead-in/lead-out moves for compensation startup

Common Mistakes

  • Using tool radius equal to or larger than arc radius
  • Incorrect G41/G42 direction selection
  • Programming zero-radius arcs with compensation active

Related Alarms

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.