Problem with AlarmAcknowledged flag

In trying to answer another forum post, I have found what I think is a problem with the AlarmAcknowledged flag.

Classically, an alarm has 4 states:

In alarm, unacknowledged
In alarm, acknowledged
Out of alarm, unacknowledged
Out of alarm, acknowledged

Other SCADA packages provide flags for alarm active and alarm unacknowledged. Ignition supplies flags for AlarmActive and AlarmAcknowledged. When the system is first started these flags have the following values:AlarmActive = 0 AlarmAcknowledged = 0If a tag goes into alarm these change toAlarmActive = 1 AlarmAcknowledged = 0If the alarm is then acknowledged the flags are AlarmActive = 1 AlarmAcknowledged = 1When the point goes out of alarm the flags change toAlarmActive = 0 AlarmAcknowledged = 1If however the point goes into alarm and back out without being acknowledged, the flags areAlarmActive = 0 AlarmAcknowledged = 0If the tag is now acknowledged, the flags values stay at AlarmActive = 0 AlarmAcknowledged = 0This is clearly inconsistent.

By using an acknowledged flag instead of an unacknowledged flag, this flag will need to remain set whenever a tag has been in alarm and unacknowledged, including when the system is first launched, otherwise inconsistent results are obtained. My vote would be for an Unacknowledged flag set when a tag goes into alarm and cleared whenever the tag is acknowledged.

The thing with the alert flags is that they only monitor the current alert state of the tag. It’s probably incorrect for the acknowledged flag to stay high when the tag goes out of alert. I’m not really sure what the best solution for this issue in regards to how those flags work. I’ll put this in as a bug fix (to get the acknowledged flag to be set back to zero when the alert clears) and then add a feature request to have this system looked at.

Hi,

I agree with Dave, the current property should probably be read as “current alarm ack’d”. That said, having a property that says that the tag has some unacked alarm is probably a good idea. It would be considerably easier in 7.6, so I think that’s where it’ll probably be introduced.

Regards,

Unfortunately if the acknowledged flag is reset when the point goes out of alarm, it will not be possible to highlight when a tag goes into alarm and back out without being acknowledged - this is despite the alarm viewer being able to display this condition.

I usually combine the alarm flags to animate the background colour of navigation buttons, so that the user is warned about the alarm states of areas he is not currently viewing. It does not currently seem possible to do this fully, so points can go in and out of alarm without the operator being able to tell which areas the alarms occurred in.

This used to be possible with FactoryPMI…

And how did you do it in PMI? Because back then, the alert properties on the tag didn't even exist.

I suspect you would query the alert status table for counts of unack'd alarms based on tag path. And, you still can. The status table doesn't exist any longer, because the same information can be derived from the log table, but basically you could query the count of null values in the ack timestamp column, potentially filtered by path or state name.

Regards,

As a workaround for this, I created the following Gateway Event Script:query = """ SELECT PATH, IF(COUNT(CLEARED_TIMESTAMP) < COUNT(ACTIVE_TIMESTAMP), 1, 0) + 2 * IF(COUNT(ACK_TIMESTAMP) < COUNT(ACTIVE_TIMESTAMP), 1, 0) AS state FROM alert_log WHERE PATH IN ( 'full path to alarm 1', 'full path to alarm 2', 'full path to alarm 3', 'full path to alarm 4', 'full path to alarm 5' ) GROUP BY PATH """ data = system.db.runQuery(query) for row in data: system.tag.write(row["PATH"] + " alarm", row["state"]) For every alarm (I’m only showing 5 here) you need to create a matching Memory SQLTag of data type ‘Int1’ with the same path and tagname, except that the tagname has ’ alarm’ appended to it.

Every time the script is run, the following alarm state will be written to the ’ alarm’ tags:In alarm, unacknowledged = 3 Out of alarm, unacknowledged = 2 In alarm, acknowledged = 1 Out of alarm, acknowledged = 0You can then use the value of the ’ alarm’ tags to animate items on-screen. This works well, but hopefully this functionality will be included in the alarm system update :wink: