In industrial automation, even minor interruptions can result in substantial losses in productivity and revenue. To minimize downtime and enhance system reliability, Rockwell PLCs support a configurable fault handler program that enables the system to respond to faults in a controlled and effective manner. This article explores what controller faults are, why fault handling can be useful, and how to implement a fault handler in your Rockwell PLC program.
Understanding Controller Faults
A fault disrupts normal PLC execution and can stem from logic errors, data issues, or hardware problems. Rockwell controllers classify faults as either minor or major. Minor faults are logged but do not stop the program. Major faults, however, halt execution and must be cleared or acknowledged.
Fault Type Comparison
Feature | Minor Fault | Major Fault |
---|---|---|
Program Execution | Continues | Halts until fault is cleared or acknowledged |
Severity | Low | High |
Example Causes | Overflow, underflow warnings | Invalid index, Negative timer preset |
Recovery | Yes | Intervention required |
Visibility | Logged in controller | Data removed after clearing |
By proactively handling recoverable major faults, users can reduce the impact of these interruptions. More importantly, controller fault data can be logged for the future and displayed on the HMI, so operators can see exactly what happened.
Creating the Fault Handler in Studio 5000
Setting up a fault handler in Rockwell’s Studio 5000 environment is a relatively simple process, but it’s important to follow the correct structure and understand what happens under the hood. The controller fault handler allows fault conditions to be handled programmatically, and in some cases, recovered from without halting the entire system.
Note: You cannot add a fault handler routine to a program while online. The project must be offline, and the program must be downloaded to the PLC for the fault handler to take effect.
Step 1: Create a Controller Fault Handler Program
Open your project in Studio 5000 Logix Designer. In the Controller Organizer, right-click the Controller Fault Handler folder and select New Program. Name the program according to your project standards (e.g., ControllerFaults) and ensure the Schedule In option is set to “Controller Fault Handler”.

Step 2: Add a Routine to the Fault Handler Program
Once the program is created, right-click it and choose Add > New Routine. Assign a descriptive name such as “HandleMajorFaults”.

Step 3: Define a UDT to Store Fault Information
To identify the fault and capture its data for logging or HMI display, create a user-defined data type (UDT). This structure should match Rockwell’s recommendation for storing a program’s MajorFaultRecord.
In the Controller Organizer, right-click Data Types > User-Defined and create a UDT (e.g., FAULTRECORD). The structure should include the following attributes:
Data Type: FAULTRECORD |
---|
Name | FAULTRECORD |
Description | Stores the MajorFaultRecord attribute or MinorFaultRecord attribute of the Program object |
Members |
---|
Name | Data Type | Style | Description |
---|---|---|---|
Time_Low | DINT | Decimal | Lower 32 bits of the fault timestamp value |
Time_High | DINT | Decimal | Upper 32 bits of the fault timestamp value |
Type | INT | Decimal | Fault type (program, I/O, and so forth) |
Code | INT | Decimal | Unique code for the fault |
Info | DINT[8] | Hex | Fault specific information |

Note: The Type and Code fields are used to identify the fault and determine the appropriate response.
The Info attribute contains encoded data related to the fault, but its format is not human-readable.
Step 4: Write the Fault Handling Logic
In your routine, use the GSV (Set System Value) instruction to retrieve fault details from the MajorFaultRecord attribute. Store this data in a tag using the FAULTRECORD type.
Then, add logic to evaluate the fault’s type and code.

If the fault is one that should be auto-recoverable (e.g., an invalid array index), use the SSV (Set System Value) instruction to clear it. A MOV instruction can be used to write the fault data to the HMI.
The two EQU instructions compare the fault type and code to identify the fault condition. Each recoverable fault you wish to handle requires a separate rung that checks for that fault’s unique type and code. Faults are categorized using numeric values; a complete list is available on the Rockwell Automation website here.
Note: When a controller faults, it provides the exact location of the fault. This location is not included if the fault is caught by the handler.
Important: Only clear faults that are known and safe to recover from. Avoid clearing all faults indiscriminately, as this could hide critical system issues.
Step 5: Testing and Validation
To verify your fault handler, induce a fault manually and confirm that the system logs and processes it correctly. A common test involves assigning a negative value to a timer preset, which triggers a major fault when executed. Be sure to have a rung in the fault handling routine that is specifically looking for the timer preset fault code and type.

You can test other faults as well, but be cautious. Only test conditions that you have configured the fault handler to manage, as unhandled faults will stop the PLC and may interrupt production.
Rockwell provides a tutorial on creating fault handlers, which includes additional examples and best practices, which can be found here.
Summary
Implementing a controller fault handler in your Rockwell PLC program provides a structured way to manage recoverable runtime faults. It helps reduce unplanned downtime, preserves fault data for diagnostics, and supports smoother system recovery.
If you’re working through a fault-handling strategy or looking for ways to improve system resilience, contact us today to learn more about our solutions and how we can help you implement smarter, more resilient PLC programs that keep your production line running efficiently.
Ready to take your Automation project to the next level?
Contact us today to learn more about our solutions and how we can help you achieve your goals.