FANUC codes
FANUCProgram/G-codeBasic10-20 minutes

313

Fanuc Alarm 313 - ILLEGAL LEAD COMMAND

MACRO ALARM 313

The variable-lead threading increment specified in address K exceeds the specified maximum value, or a negative lead value was specified.

Root Cause Summary

Alarm 313 occurs during variable-lead threading (G34/G35) when the K address value specifying the thread lead increment per spindle revolution exceeds the maximum allowable value set in Parameter 5130, or when a negative lead value is commanded. This is a program data validation error that prevents execution of an invalid threading cycle.

Causes and Fixes

  1. 1

    Navigate to SYSTEM > PARAM and locate Parameter 5130 (maximum thread lead increment for variable-lead threading). Note the current value in millimeters or inches depending on system units (G20/G21).

  2. 2

    Review the program line causing alarm 313 and verify the K address value. For G34 (variable-lead threading increasing), check that K value does not exceed Parameter 5130. Calculate total lead change: initial lead (F) + (K × number of spindle revolutions).

  3. 3

    Either reduce the K value in the program to stay within Parameter 5130 limits, or increase Parameter 5130 if the application requires larger lead increments and machine mechanics support it.

    Increasing Parameter 5130 requires understanding of machine mechanical limits, spindle synchronization capabilities, and maximum axis feed rates. Consult machine builder specifications before modification.

  4. 4

    After correction, reset alarm with RESET key, return to program start or safe line, and test threading cycle in single block mode with feedrate override at 50% to verify proper execution.

DIY Feasiblehigh confidence

Call a technician if:

  • ·Parameter 3781 changes don't resolve the issue
  • ·Threading option not installed
  • ·Macro programming beyond operator skill level

Prevention

  • Always validate K values are positive and reasonable before program execution
  • Document threading parameter settings in machine setup sheets
  • Use macro variable range checking for calculated threading values

Common Mistakes

  • Confusing K increment value with total thread lead
  • Using negative K values instead of proper left-hand thread syntax
  • Not checking parameter 3781 limits when programming large lead increments

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.