PLC Fault Handling: Major Fault, Minor Fault Codes and Recovery Steps

Share:
DCS and Automation
PLC Fault Handling: Major Fault, Minor Fault Codes and Recovery Steps

A PLC fault stops or disrupts the scan cycle and requires a structured response before the controller returns to normal operation.

Understanding whether a fault is major or minor, recoverable or non-recoverable, determines the correct recovery procedure.

This guide covers the PLC fault classification system, the most common fault codes, and the step-by-step recovery procedure used in the field.

Major vs Minor Fault Recoverable vs Non-Recoverable Type and Code System Fault Routine Programming

A major PLC fault halts program execution immediately and puts the controller into faulted mode. All outputs go to their configured fault state and the machine stops.

A minor fault is logged but does not stop the program. Reading the fault code before touching anything is the most important step in any PLC fault recovery.

PLC fault

PLC Fault Classification: Major, Minor and I/O Faults

Hello! Today we are covering PLC fault handling: how faults are classified, what the fault codes mean, and how to recover from them safely. This applies to Allen-Bradley Logix controllers (ControlLogix, CompactLogix) as the primary example, with equivalent concepts for Siemens S7 and Mitsubishi MELSEC platforms. The core logic is the same across all platforms — only the menu names and code numbers differ.

Every PLC fault is assigned a type number and a code number. The type identifies the category of fault. The code identifies the specific condition within that category.

These two numbers together tell you exactly what went wrong, where it happened in the program, and whether the controller can recover without a download or hardware intervention.

Did You Know? In Allen-Bradley Logix5000 controllers, the fault log stores the last 16 fault events with timestamp, type number, code number, and a text description.

This log is your first diagnostic resource whenever a PLC fault occurs. Engineers often clear the fault immediately under production pressure — and then lose this information permanently.

Always read and record the full fault log entry (type, code, description, timestamp) before pressing any clear or reset button. A screenshot takes 5 seconds. It can save hours of guesswork when the fault returns.
Major
Halts program scan. Controller enters faulted mode. All outputs go to configured fault state.
Minor
Logged in the fault register. Program continues running. A status bit is set for the program to act on.
Recoverable
Fault can be cleared after fixing the cause. Program resumes without a new download.
Non-recoverable
Hardware or firmware level problem. May require firmware reload, battery replacement, or CPU swap.
Advertisement

Major PLC Fault: What Happens and Common Fault Codes

When a major PLC fault occurs, the controller immediately stops the program. The scan cycle does not complete the current rung.

Outputs go to their configured fault state — typically de-energised, or held at the last value depending on module configuration.

The controller status LED changes from green (RUN) to flashing red (FAULTED). The controller will not re-enter RUN mode until an operator or engineer explicitly clears the fault.

Common Major PLC Fault Codes (Allen-Bradley Logix)

TypeCodeDescriptionCommon Cause
Type 4Code 4Array subscript out of rangeIndex variable exceeds the defined array bounds. Common in FOR loops iterating beyond the array size.
Type 4Code 20Divide by zeroA division instruction executes when the divisor tag equals zero. Common in ratio or averaging calculations.
Type 4Code 31Stack overflowToo many nested subroutine calls. Recursive calls that never return are the most common cause.
Type 1Code 16Watchdog timeoutProgram scan took longer than the configured watchdog time. Common during complex calculations or long FOR loop iterations. See the watchdog timer guide for details.
Type 6Code 1Power supply voltage lowDC bus voltage fell below the minimum threshold. Check the power supply and backplane connections.
Type 8Code 4Flash update requiredFirmware version mismatch between CPU and installed modules. Update firmware to matching versions.
Type 2Code 1I/O module connection lostAn I/O module stopped communicating during RUN mode. Cable, module failure, or chassis seat issue. See the communication protocols guide.
Tip: Type 4 faults (program execution) are the most common in the field.

Type 4 Code 4 (array subscript out of range) and Type 4 Code 20 (divide by zero) together account for the majority of major program faults on production controllers.

Both are preventable with defensive programming. For array access: verify the index tag cannot exceed the array bound before the instruction executes. For division: add a zero-check rung before any DIV instruction. If the divisor equals zero, the rung branches to a safe default rather than allowing the division to execute.

Minor PLC Fault: Behaviour and Common Codes

A minor fault does not stop the program. It sets a bit in the controller's minor fault status word and logs the event in the fault register. The program continues scanning normally.

The value of a minor fault depends entirely on whether the program contains logic to act on the minor fault status word.

Without fault-handling logic, a minor fault is logged but nothing else happens — no alarm, no indication to the operator, no corrective action.

TypeCodeDescriptionNotes
Type 4Code 3Arithmetic overflowResult of a calculation exceeded the data type range. The result is clamped; the program continues.
Type 4Code 7Illegal instructionAn instruction that is not valid for the current controller firmware was encountered.
Type 2Code 1I/O connection fault (minor)I/O module fault that has been configured as minor rather than major. The module's "Major Fault On Controller" option was disabled in module properties.
Type 3Code 1Battery low or missingThe controller's internal battery voltage is low. Program memory is at risk if power is lost. Replace the battery promptly.
Type 10Code 10Output point fuse blownAn output module's electronic fuse has tripped. The specific output point is identified in the code details.
Tip: Always include a minor fault routine in your controller program.

The minor fault routine runs once when a minor fault occurs, before the next scan cycle begins. Use it to copy the minor fault type and code to a DINT tag pair, trigger an alarm output, and write the event to a log array.

Without this routine, a Type 3 Code 1 battery low fault will sit silently in the fault register for weeks. The battery will eventually die and the program may be lost during the next power interruption. A minor fault routine with a horn or HMI alarm page turns this from a silent risk into an immediate action item.
Advertisement

PLC Fault Recovery: Step-by-Step Procedure

The recovery procedure has seven steps. Never skip Step 1 — reading the fault information before clearing it is the most critical discipline in PLC fault handling.

Read and record the fault information. Go online with your programming software (Studio 5000, TIA Portal, GX Works). Open Controller Properties and navigate to the Faults tab. Write down the Type number, Code number, fault description, and timestamp. Take a screenshot. Do not clear the fault yet.
Identify the fault category. Is it a major or minor fault? Is it recoverable or non-recoverable? The fault description will indicate this. Recoverable major faults can be cleared without a download. Non-recoverable faults (such as Type 1 Code 60 on ControlLogix) require firmware reload or CPU replacement.
Identify the root cause. For a Type 4 Code 4 fault: check which routine faulted and which array index was out of range. For a Type 4 Code 20 fault: find the DIV instruction and trace which tag was zero. For a Type 1 Code 16 watchdog fault: check the program scan time and identify any long FOR loops or complex nested calls. See the memory addressing guide for how array addressing errors occur.
Check whether the process is safe to restart. Before clearing the fault and returning the controller to RUN mode, confirm that the process is in a safe state. Valves should be in the correct fail-safe position. Motors should be stopped. Personnel should be clear of moving parts. Confirm with the operator before proceeding.
Clear the fault. In Studio 5000: go online, open Controller Properties, select the Major Faults tab, and click Clear Majors. Alternatively, use the controller's physical key switch (if fitted): turn to PROG, then back to REMOTE RUN or RUN. In TIA Portal: use the STOP to RUN transition after correcting the fault condition in the program.
Fix the root cause before returning to RUN mode. Clearing the fault without fixing the cause will result in the same fault recurring on the next scan cycle. Fix the program fault (bounds check, zero-check, reduced loop count) and download the corrected program before switching back to RUN. See the counter instructions guide for how loop counters interact with array bounds.
Verify normal operation after restart. Monitor the first few scan cycles online. Confirm the program scan time is within limits and the watchdog timer is not approaching its limit. Confirm all I/O modules are communicating. Confirm that no new minor faults have been logged. Document the fault event and the corrective action taken in the maintenance management system.
Did You Know? In Allen-Bradley Logix controllers, you can program a controller-level fault routine that runs automatically when a major fault occurs — before the controller goes to faulted mode.

The fault routine can read the fault type and code using a GSV (Get System Value) instruction targeting the CONTROLLER object's MAJORFAULTBITS and MINORFAULTBITS attributes. It can then write these values to a DINT pair, trigger a horn output, or copy a safe state to all outputs before the controller halts.

If the fault routine successfully executes without faulting itself, it can even clear the fault using a CLF (Clear Fault) instruction and return the controller to RUN mode automatically — making the fault self-recovering for known, safe transient conditions.
Advertisement

PLC Fault Diagnosis Tool

PLC Fault Category and Recovery Guide
Select the fault type and category to get the recovery procedure
-
-

Watch: PLC Fault Finding in RSLogix 5000

PLC Fault Handling Questions

What is a major PLC fault?
A major PLC fault halts the program scan and puts the controller into faulted mode. All outputs go to their fault state. The controller needs an explicit clear before returning to RUN mode.
What is the difference between a recoverable and non-recoverable PLC fault?
A recoverable fault clears after the root cause is fixed and the program resumes without a download. A non-recoverable fault persists through power cycles and requires firmware reload or CPU replacement.
Why does my PLC keep faulting with the same code?
Clearing a PLC fault without fixing the root cause causes the same fault on the next scan. Fix the program logic or hardware condition before returning the controller to RUN mode.
What is a PLC fault routine?
A fault routine runs automatically when a fault occurs. It reads the fault type and code via GSV, logs them to tags, and can trigger alarms or move outputs to a safe state.
What should I do first when a PLC fault occurs?
Read and record the fault type, code, and description before pressing any clear button. This information is overwritten when the fault is cleared — losing it makes root cause analysis much harder.

External References

Advertisement

What We Learn Today

  • A major PLC fault halts the scan and puts the controller in faulted mode. A minor fault is logged but does not stop the program. Always read the Type and Code numbers from the fault log before clearing — this information is your root cause starting point.
  • Type 4 faults (program execution) are the most common in the field. Code 4 (array out of bounds) and Code 20 (divide by zero) are both prevented by defensive programming: bounds checks and zero-checks before the critical instruction.
  • The 7-step recovery procedure is: read, classify, find root cause, confirm process safety, clear, fix, verify. Clearing without fixing guarantees a repeat fault on the next scan cycle.
“A PLC fault is the controller telling you something it cannot handle safely. The fault code is the message. Clearing it without reading it is like hanging up on someone mid-sentence and wondering why the problem keeps calling back.”

Leave a Reply

Your email address will not be published. Required fields are marked *