FANUC codes
FANUCProgram/G-codeIntermediate20-45 minutes

113

Fanuc Alarm 113 - IMPROPER COMMAND

Zero Division

Fanuc alarm 113: Zero Division. 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

Fanuc Alarm 113 occurs when a G-code or M-code function that is prohibited within a custom macro (user macro or macro executor program) is commanded. This typically happens when attempting to use external I/O instructions, certain program control commands, or machine-specific functions inside macro variables O9000-O9999 series programs that are restricted by the CNC system architecture.

Safety

  • Program execution will halt - ensure workpiece and tooling are secure before restart
  • Incorrect program logic leading to a zero division error can cause unexpected machine behavior. Ensure the machine is in a safe state before running or debugging the program.
  • Be aware of rapid machine movements during program execution. Keep a safe distance from moving parts.
  • If the error occurs during automatic operation, be prepared to activate the emergency stop if necessary.
  • Modifying machine parameters or programs should only be done by qualified personnel.

Causes and Fixes

  1. 1

    Identify the exact line number in the custom macro program (O9xxx series) where alarm triggered by reviewing alarm history screen (ALARM > HISTORY) to see NC program name and sequence number.

  2. 2

    Check if G04 (dwell), G10 (programmable data setting), G65/G66/G67 (macro call nesting beyond 4 levels), or external device commands (DPRNT, POPEN) are used in the macro program at the flagged line.

  3. 3

    Verify parameter 6071 (macro call nesting level) and parameter 6005 bit settings which control allowable macro functions - access via SYSTEM > PARAM > search 6005 or 6071.

  4. 4

    Remove or relocate the prohibited command outside the macro body into the main program, or replace with macro-compatible alternatives (use #3003 timer instead of multiple G04, use SETVN instead of G10 where applicable).

DIY Feasiblehigh confidence

Call a technician if:

  • ·Complex nested macro programs with multiple subroutines
  • ·Alarm persists after variable initialization fixes
  • ·System parameters related to macro execution need modification

Prevention

  • Always initialize macro variables before use
  • Implement input validation for all divisor variables
  • Use conditional logic to check for zero values before division
  • Enable macro variable monitoring during program development

Common Mistakes

  • Assuming variables retain values between program cycles
  • Not checking calculation results before using as divisors
  • Using uninitialized local variables in subroutines
  • Forgetting that empty variables evaluate to zero in mathematical operations

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.