Chapter 1 Major Faults
Rockwell Automation Publication 1756-PM014N-EN-P - March 2022 23
If controller is revision
During prescan, the controller automatically clears any faults due to an array
subscript that is beyond the range of the array (out of range).
This example shows a fault routine that clears a major fault that occurs during
prescan.
It is good programming practice to check for a specific fault before clearing that fault.
controller is in prescan.
The program's fault routine uses the status of this bit to determine if the fault occurred during prescan or
normal scan of the logic.
• During prescan, this bit is off. During prescan, the controller resets all bits referenced by OTE instructions.
• When the controller begins to run the logic, the CPU_scanning bit is always on.
code
The GSV instruction does the following:
• Accesses the program's MajorFaultRecord attribute. This attribute stores information about the fault.
• Stores the fault information in the major_fault_record (of type FAULTRECORD) tag. When entering a tag that
is based on a structure, enter the first member of the tag.
fault
The first EQU instruction checks for a fault of Type 4, which means that an instruction in this program caused
the fault.
The second EQU instruction checks for a fault of Code 20, which means that either an array subscript is too
large, or a POS or LEN value of a CONTROL structure is invalid.
The first CLR instruction sets the value of the fault type in the major_fault_record tag to zero.
The second CLR instruction sets the value of the fault type in the major_fault_record tag to zero.
The SSV instruction does the following:
• Writes the new values to the program's MajorFaultRecord attribute.
• Writes the values contained in the major_fault_record tag. Because the Type and Code member are set to
zero, the fault clears and the logix starts running again.
See also
Fault handling during prescan and postscan on page 11