FANUC codes
FANUCProgram/G-codeIntermediate10-30 minutes

PS124

Fanuc Alarm PS124 - Macro END Not Found

MISSING END STATEMENT

Fanuc alarm PS124: MISSING END STATEMENT. The part program or machine configuration has an error related to this alarm condition. Review the block indicated in the alarm screen and correct the command per the Fanuc programming manual.

Root Cause Summary

PS124 alarm occurs when the Fanuc macro compiler detects an incomplete control structure in a custom macro program (G65/G66 or macro variable program). The control detects a missing END statement for IF-THEN-ELSE, WHILE-DO, or DO-END loop structures during program syntax checking. This is a macro syntax error that prevents program execution until the macro code structure is corrected.

Safety

  • Check complete macro logic

Causes and Fixes

  1. 1

    Access the macro program in EDIT mode. Press PRGRM key, locate the O-number or subprogram containing macro variables (#1-#33 local, #100-#999 common). Review all IF statements for matching END statements.

  2. 2

    Count IF-THEN occurrences and corresponding END statements. For nested IF blocks, each level requires its own END. Verify structure: IF[#1 EQ 1]THEN / (statements) / END. Check parameters 6001-6049 (macro variable settings) are enabled if macro appears inactive.

  3. 3

    Add missing END statement(s) before program termination (M99 for subprogram or M30 for main). Ensure END placement is logically correct for the intended control flow structure.

  4. 4

    Reset alarm with RESET key, perform dry run test (SINGLE BLOCK + DRY RUN active). Monitor CURRENT screen (PRGRM > CURRENT) to verify macro execution path follows intended logic without PS124 reoccurrence.

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.