الثلاثاء، 9 نوفمبر 2010

Fault Detection and Interrupts


Fault Detection and Interrupts
The PLC can be set up to run programs automatically using interrupts. This is routinely
done for a few reasons;
• to deal with errors that occur (e.g. divide by zero)
• to run a program at a regular timed interval (e.g. SPC calculations)
• to respond when a long instruction is complete (e.g. analog input)
• when a certain input changed (e.g. panic button)
These interrupt driven programs are put in their own program file. The program
file number is then put in a status memory S2 location. Some other values are also put into
status memory to indicate the interrupt conditions.
A fault condition can stop a PLC. If the PLC is controlling a dangerous process
this could lead to significant damage to personnel and equipment. There are two types of
faults that occur; terminal (major) and warnings (minor). A minor fault will normally set
an error bit, but not stop the PLC. A major failure will normally stop the PLC, but an interrupt
can be used to run a program that can reset the fault bit in memory and continue operation
(or shut down safely). Not all major faults are recoverable. A complete list of these
faults is available in PLC processor manuals.
Figure 16.15 shows two programs. The default program (file 2) will set the interrupt
program file to 3 by moving it to S2:29 on the first scan. When A is true a compute
function will interpret the expression, using indirect addressing. If B becomes true then the
value in N7:0 will become negative. If A becomes true after this then the expression will
become N7:-10 +10. The negative value for the address will cause a fault, and program
file 3 will be run. In fault program status memory S2:12 is checked the error code 21,
which indicates a bad indirect address. If this code is found the index value N7:0 is set
back to zero, and S2:11 is cleared. As soon as S2:11 is cleared the fault routine will stop,
and the normal program will resume. If S2:11 is not cleared, the PLC will enter a fault
state and stop (the fault light on the front of the PLC will turn on).

ليست هناك تعليقات:

إرسال تعليق