How to count the subset of of act/unacked alarms in perspective status table?

Gateway tag give us an easy way of displaying on the top banner the number of active and unacknowledged alarms by binding display to the gateway system tags.

What about situation when i only want to count a subset of these alarms based on some display path criteria? Shall i use [system.alarm.queryStatus] function to filter the number of alarms or maybe there is simpler method to achieve that?
How to display it on the top banner - message handler?


(system.alarm.queryStatus - Ignition User Manual 8.1 - Ignition Documentation)

That queryStatus call is the way to go, but there's no native way to display that count in the Table itself - you'll need to place a Label component somewhere in your View and bind the text of the Label to a parameterized call, or multiple labels bound to static calls.

1 Like

thanks for reply.
Any chance you explain bit more what you meant by the statement above ?

I have hybrid solution using standard alarm status display but i wanted to use query status function to display correct number of relevant alarms.

Please excuse the format of this code, but I did it as fast as I could to get a working example. The result of this binding and transform is a Label which displays the number of alarms which match the filters currently applied to the Alarm Status Table.

While the Alarm Status Table will only ever display the number of "Active" alarms while viewing the ACTIVE tab, this Label will display the count of all alarms which match the applied filters.

I have placed a Label in the same Container as my Alarm Status Table, and I've applied an Expression Binding to Label.props.text.

I then applied the following script transform to the binding:

def transform(self, value, quality, timestamp):
	applied_states = []
	applied_priorities = []
	if value.states.clearUnacked:
	if value.states.clearAcked:
	if value.states.activeUnacked:
	if value.states.activeAcked:
	if value.priorities.diagnostic:
	if value.priorities.low:
	if value.priorities.medium:
	if value.priorities.high:
	if value.priorities.critical:
	return len(system.alarm.queryStatus(priority=applied_priorities, state=applied_states))

If you want individual labels where one label always displays, say, "Active, Unacknowledged" alarms, then you would modify the applied_states variable in the transform to always be a list which contains a numeric value of 2 ([2], not ["2"]).

1 Like

thanks for that great help

1 Like