Bytesize said:
My task is to have our operators view processor faults on a HMI so they can quickly identify and relay problems to engineering. I was also wondering if it possible to clear processor faults through a HMI.
Yes, it is possible, and you don't necessarily have to have a fault routine - the purpose of a fault routine is to allow your process to keep running, depending on the fault. Otherwise allow the PLC to fault and stop running. Your HMI should still be able to read and modify S file bits even if the PLC program is not running.
Here is a clip from an RSView32 screen.
The PLC mode string expression references tag S_1 which is word S:1 and the expression is
Code:
if (DEVICE\S_1 & 8192) THEN "FAULT" ELSE
IF (DEVICE\S_1 & 31 = 6) THEN "REM RUN" ELSE
IF (DEVICE\S_1 & 31 = 30) THEN "RUN (KEY)" ELSE
IF (DEVICE\S_1 & 31 = 1) THEN "REM PROG" ELSE
IF (DEVICE\S_1 &31 = 17) THEN "PROG (KEY)" ELSE
IF (DEVICE\S_1 &3 = 3) THEN "SUS IDLE" ELSE "?"
The PLC Fault Code displays S:6
The Fault/Power down File/Rung displays S:21/S:20
The REMOVE FAULT button resets S:1/13 and S:6 by executing the following
Code:
DEVICE\S_1_13_FAULT=0;
DEVICE\S_6=0
The REMOVE FAULT button has visibilty animation on it so that it is visible only when S:1/13 is set.
The battery status string expression is
Code:
If (DEVICE\S_5_11) THEN "LOW" ELSE "OK"
In this case once the fault is removed the PLC is placed back in run mode with the keyswitch, but you could place a button on the HMI to put the PLC back into REM RUN mode after the fault has been cleared, provided the key switch is in the REM position. Refer to the S file bits in the instruction set reference manual to see which S:1 bits to test to see where the keyswitch is and which bits to set to re-enter REM RUN.
Additonally, you can set up your HMI to log fault codess to a data base whenever the value of S:6 changes, or you can set up an alarm triggered on S:1/13 and log it to the alarm log - this way you have a record of any faults that are reset by someone else.