
axismd.ai
FANUC Controller
Program/G-code · Intermediate · 5-30 minutes
Fanuc 331 - Illegal command in peck drilling
Alarm 331 occurs when the control detects an improper command or parameter within a canned cycle peck drilling operation (G73, G83, or G87). This typically results from missing required parameters, conflicting modal commands, or illegal G-code combinations that violate the peck drilling cycle execution rules.
Fanuc 331 - Illegal command in peck drilling
ILLEGAL COMMAND IN PECK DRILLING
Fanuc PS program alarm 331: ILLEGAL COMMAND IN PECK DRILLING. This alarm is triggered by an illegal or incorrectly formatted command in the part program, or a programming condition that the Fanuc control cannot execute.
Root Cause Summary
Alarm 331 occurs when the control detects an improper command or parameter within a canned cycle peck drilling operation (G73, G83, or G87). This typically results from missing required parameters, conflicting modal commands, or illegal G-code combinations that violate the peck drilling cycle execution rules.
Safety
Causes and Fixes
Locate the alarm line number in the program and identify the G83 or G73 block causing the alarm.
Verify Q value (peck increment) is present and is a positive non-zero value. Check that R-plane is above the Z-depth value.
Confirm all required addresses are present: X, Y (or one axis for single-axis drilling), Z (final depth), R (retract/reference plane), Q (peck depth), and F (feedrate).
Correct the missing or invalid parameters, ensure R > Z in negative Z drilling (R-plane must be above final depth), then reset alarm and test cycle.
Seeing Multiple Alarms?
Seeing another alarm with this one? Enter the code.
AxisMD logs alarms against your actual machines, tracks patterns, and gives AI context your manual doesn't have.
Start freeWas this guide helpful?
Always verify with your machine manual or a certified technician before performing service procedures.