Writing a fault routine – Rockwell Automation 1785-LTx,D17856.2.1 Classic PLC-5 Programmable Controllers Users Manual User Manual

Page 85

Advertising
background image

Selecting Interrupt Routines

Chapter 7

7-3

You can write a fault routine that the processor runs when it detects a
major fault. For example, if your program file becomes corrupted, you can
tell the processor to interrupt the current program, run your fault routine
and then continue processing the original program.

This section shows you how to set and write a fault routine and how to
protect your processor from powering up in run mode after a power loss.

Responses to a Major Fault

When the processor detects a major fault, the processor immediately
interrupts the current program. If a fault routine exists (i.e., specified in
S:29 as a fault routine), the processor runs that fault routine program for
recoverable faults. Then, depending on the type of fault, the processor:

returns to the current ladder program file if the processor can recover

from the fault

enters fault mode if the processor cannot recover from the fault

For example, the rung in Figure 7.3 includes an instruction that causes
a major fault.

Figure 7.3

Sample Ladder Logic for a Fault

] [

A B C

Causes a

major fault

In the example in Figure 7.3, the processor runs the fault routine after
detecting the fault. If the fault routine resets the faulted bits, the processor
returns to the next instruction in the program file that follows the one that
faulted and outputs on the remainder of the rung.

If you do not program a fault routine for fault B, the processor
immediately faults.

The bits in word 11 of the processor status file indicate the type of major
fault. See Table 7.G to determine whether a fault is recoverable.

Writing a Fault Routine

Advertising