FANUC codes
FANUCProgram/G-codeBasic10-20 minutes

127

Fanuc Alarm 127 - DUPLICATE NC MACRO STATEMENT

SYSTEM ALARM 127

Fanuc alarm 127: SYSTEM ALARM 127. This alarm indicates a fault condition detected by the Fanuc control. Refer to the alarm number and name to identify the specific system or function involved.

Root Cause Summary

Alarm 127 occurs when a standard G-code or M-code NC statement is combined with a macro statement (such as variable assignment, arithmetic operation, or control statement) within the same program block. The Fanuc control prohibits mixing these statement types because they are processed differently by the interpreter, and combining them creates ambiguous execution order.

Causes and Fixes

  1. 1

    Identify the offending block in the NC program by checking the program line number displayed with the alarm on the CNC screen. Navigate to EDIT mode and locate the block.

  2. 2

    Look for macro variable assignments (#100=5.0), arithmetic operations (#101=#100+#101), or system variable calls mixed with G-codes (G01, G02, G90, etc.), M-codes, or axis movements (X, Y, Z, etc.) in the same block.

  3. 3

    Separate the macro statement and NC statement into individual blocks. Example: Change 'G01 X100. #100=5.0' to two blocks: 'G01 X100.' on one line and '#100=5.0' on the next line.

  4. 4

    Reset the alarm by pressing RESET button, return to cycle start position if necessary, and restart the program to verify proper execution.

DIY Feasiblehigh confidence

Call a technician if:

  • ·Parameter corruption affecting macro operation
  • ·Persistent alarm after program corrections

Prevention

  • Always separate macro statements from NC commands into different blocks
  • Use proper program formatting with one statement type per block
  • Validate macro syntax before running production programs

Common Mistakes

  • Combining G65 macro calls with G01 moves in same block
  • Mixing variable assignments with M-codes
  • Improper conditional statement formatting

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.