Collecting Unack alarms in a folder

I’m trying to get all of the UnAck Alarms in a folder using the folder’s tagpath but with no success, can anyone help me with getting an alarm with all of the tags inside a folder. Kindly check the screenshot for reference.

1 Like

Where are you planning to call this from? and at what rate?
@PGriffith correct me if wrong, but calling the system.tag.browse function will hit the internal database which can can introduce performance issues, especially if you’re calling this periodically as it will lock up other processes trying to access it (single connection only).

I use system.alarm.queryStatus to summarise my alarms at different folder levels. There are however some things that you should and shouldn’t do. One thing you shouldn’t do is to call queryStatus many times. I call this once every 5s to bring back all alarms, store the results into a script variable, then filter the variable at the various other locations that I want to summarise alarms for.

Below, Area Alarms/Alarm Summary calls a script that runs the queryStatus function whose result is stored in a library variable, then all other tags filter using the library variable.

3 Likes

system.tag.browse shouldn’t need to hit the IDB in regular operation (the tag system will reside in memory) but is still less efficient than system.alarm.queryStatus, particularly as implemented in the OP, with individual calls to system.tag.read for each submember. @nminchin’s advice is probably the most performant way to go here.

For what it’s worth, there’s a typo in your code.

Line 9 has CleanUnackCount instead of ClearUnackCount