Alarm visibility based on priority - Need Help

Iā€™m not quite sure which version of coding is better or if theyre both trash so give it to me straight :smiley:

Neither of these will work as intended. To filter by state and display path you need to pass the values into the queryStatus function. Then you will get back the filtered alarms you want. For example

	stateFilter = ['ClearUnacked', 'ActiveUnacked', 'ActiveAcked']
	displayPathFilter = ['*test*', '*asdf*']
	alarmStatusInfo = system.alarm.queryStatus(state=stateFilter, displayPath=displayPathFilter)

The visibility comes from binding the minimum priority to the return value of the function. Since the function returns the highest priority of the queried alarms it will filter out all the levels below.

I would recommend changing the sort order option in the property editor to sort by priority first for now and then come back to this later when you are more comfortable with python. Because my examples are not well tested and might not work as intended. I was just trying to come up with something that might point you in the right direction.

You can change the Sort Order in the Property Editor of a Alarm Status Table. By default I think mine was State_Time.

1 Like