Haas codes
HaasProgram/G-codeBasic10-20 minutes

312

Haas 312 - PROGRAM END | Haas CNC Alarm

PROGRAM END

This alarm indicates the control has reached an M30, M02, or percent sign program terminator but has detected an error condition that prevents normal program end procedures from completing. The control expects certain machine states or completed actions before allowing program end, such as all axes stopped, spindle off, and coolant off. If these conditions are not met or the program structure is malformed, the alarm fires instead of executing the reset and rewind functions.

Root Cause Summary

Alarm 312 occurs when the Haas NGC control encounters an M98 subprogram call but cannot locate the specified O-number program in active memory. The most common cause is the subprogram was never loaded into memory or was accidentally deleted. The typical fix is loading the missing subprogram into memory via the Program menu.

Safety

  • Main program will stop

Causes and Fixes

  1. 1

    Identify the missing subprogram number

    Press ALARM to view the alarm details. Note the line number where execution stopped, then press PROGRAM and use the cursor to find the M98 line that caused the alarm. Record the O-number being called (e.g., M98 P1001 calls subprogram O1001).

  2. 2

    Check if subprogram exists in memory

    Press PROGRAM, then LIST PROG soft key. Scroll through the program list to verify if the O-number from step 1 exists in memory. If not found, the subprogram needs to be loaded.

  3. 3

    Load the missing subprogram

    Use DNC, USB, or network transfer to load the missing subprogram. Press PROGRAM, then appropriate transfer method (USB/DNC). Navigate to the subprogram file and transfer it to memory.

    Always verify subprogram dependencies before running a main program to avoid mid-cycle stops.

  4. 4

    Reset alarm and resume

    Press RESET to clear alarm 312. Press CYCLE START to resume program execution from the M98 call.

DIY Feasiblehigh confidence

Call a technician if:

  • ·Memory hardware errors preventing program storage
  • ·Persistent alarm after confirming subprogram exists and M98 syntax is correct

Prevention

  • Always verify all subprograms are loaded before running main programs
  • Use program templates with consistent O-number schemes
  • Enable memory protect for critical subprograms
  • Maintain organized backup system for all programs and subprograms

Common Mistakes

  • Assuming subprograms transfer automatically with main programs
  • Not checking O-number syntax when copying M98 calls between programs
  • Deleting subprograms without checking if other programs call them
  • Running programs without verifying all dependencies are in memory

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.