FANUC codes
FANUCProgram/G-codeAdvanced30-60 minutes

118

Fanuc Alarm 118 - TOO MANY BRACKET NESTING

TOO MANY BRACKET NESTING

Fanuc PS118: The nesting depth of brackets [ ] in a macro arithmetic expression has exceeded the maximum allowed level. Fanuc custom macros limit how deeply brackets can be nested in a single expression.

Root Cause Summary

Alarm 118 indicates that the CNC has detected corruption in the program memory (RAM or SRAM). This typically occurs due to battery failure causing data loss during power-off, electrical noise/interference affecting memory integrity, or hardware failure of the memory module or main PCB. The system performs checksum verification on stored data and triggers this alarm when mismatches are detected.

Safety

  • Programs may be lost

Causes and Fixes

  1. 1

    Check battery voltage at DIAGNOSIS screen > STATUS > BATTERY. Verify absolute encoder battery shows above 3.0V and main battery above 3.2V. On older systems, access via SYSTEM > DIAGNOSIS > #196 (battery voltage).

  2. 2

    Inspect physical battery condition on the main PCB and servo amplifier. Look for corrosion, swelling, or date code indicating age over 5 years. Replace batteries immediately if voltage is low or physical damage present.

    Always perform controlled shutdown and maintain AC power when replacing main CPU battery to prevent total memory loss. Have backup files ready.

  3. 3

    After battery replacement, restore all parameters from backup using SYSTEM > PMC > I/O or memory card restore function. Verify parameter set with OEM documentation.

  4. 4

    Clear alarm by power cycling the control. Re-establish reference position for all axes (return to zero). Verify PMC ladder program and all macro variables are intact.

DIY Feasiblehigh confidence

Call a technician if:

  • ·Memory corruption persists after program reload
  • ·Parameter corruption affects multiple system functions
  • ·Hardware memory failure suspected

Prevention

  • Limit macro nesting to maximum 4 levels
  • Use subroutines instead of deep nesting
  • Regular macro program backup
  • Validate macro syntax before execution

Common Mistakes

  • Counting only IF statements without including function brackets
  • Ignoring recursive call depth in nesting calculation
  • Not backing up programs before editing
  • Mixing different bracket types incorrectly

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.