You can use the function
AlarmFirstCatRec() to find alarms in any area. This function can
only be called on the alarm server, so if you want the result on a
Citect Client send the output to a Disk PLC. For example:
FUNCTION
CheckAlarms()
INT nRec;
WHILE TRUE DO
nRec = AlarmFirstCatRec(0, 1,
20);
IF nRec = -1 THEN
IF AlarmArea20
<> 0 THEN
AlarmArea20 = 0;
END
ELSE
IF AlarmArea20
<> 1 THEN
AlarmArea20 = 1;
END
END
Sleep(10);
ReRead(0);
END
END
This function uses AlarmFirstCatRec to check for any
unacknowledged alarms in area 20. If any alarms are found, then the
disk PLC variable AlarmArea20 is set to 1, otherwise it is 0. The
variable is only written to if it needs to be changed - this saves
unnecessary writes to the disk PLC. The function then sleeps for 10
seconds to stop excessive use of CPU. The Citect clients can then
display the value of AlarmArea20 to show if alarms exist in this
area. You should add extra disk PLC variables as required for each
area of your plant. |