Displaying Alarm Count

I am trying to display a number of alarms that are active. However, I am trying to display certain alarms. I have the alarms that I am wanting to display in a group called “Spray Status”. Is there a way to display how many alarms are active in that group?

Try this:

properties = [("Group","=","Spray Status")]
tags = system.alarm.queryStatus(source=["*"],all_properties=properties)
print len(tags)

Please note that this assumes you have associated data configured on those ‘certain’ alarms named ‘Group’. If this is not the case just change the first element of the tuple list named properties.
Also note that if the alarms are already active in the system and you have added the associated data after they have went into alarm, they will not return in this query.
Hope this helps

1 Like

is there any way to bind components to the alarm count? not seeing any intuitive way of seeing alarm counts in real time other than by using ‘runscript’

Download, restore and play with this IA official demo project. You will find almost every Ignition feature and functionality implemented here.

Ignition Demo Project Gateway Backup - 34 MB.

The best tools to master Ignition are:

  1. Demo project
  2. IA University
  3. User manual
  4. Cloud template browser in designer under tools menu
  5. Forum search.
  6. Ignition SDK.

Not seeing anywhere in the demo that you can get any sort of polled/filtered alarm counts… can you be more specific? I’m aware that tags are automatically generated on the gateway for alarm metadata for each provider – but I don’t really want to create a separate provider for each grouping count required…
I’m aware that something of this sort can be accomplished with event-driven scripting – but was hoping for something polled/bindable…

Thanks

1 Like

Sorry for the confusion. You can find the Alarm Count template under:
"Tools/Cloud Template Browser/Alarms". Also the Alarm Analysis template in Demo project has a lot of information.
...............................

I found a better one. If you create a new project , you will find alarm count label under templates.

1 Like

Right… so that basically uses that ‘runscript’ method to determine the alarm counts within the template instance:

if({Alarm Count Label.states} = "", 

	0,

	toInt(runScript("len(system.alarm.queryStatus(state=[" + 
	left({Alarm Count Label.states}, len({Alarm Count Label.states}) - 1) +
	"]))", {Alarm Count Label.UpdateRate}))
)

but at least this is bindable :slight_smile:, and could be adapted to filter by tag folder/other sort of grouping. Perhaps it would be more efficient to create a few expression tags that utilize this, so that it is executed at the gateway once, rather than having each individual client execute it…
Wishing that the alarm info aggregate functions were more advanced than just the “isAlarmActive()”.
That “Alarm Analysis” template is pretty awesome though :slight_smile:

1 Like

Check out this one.

I’m new to ignition. I want to change the alarm count based upon what page the user is on. I was planning to do this by sorting the alarm count by tag path or tag source using a client tag which changes the client tag when the user uses the navigation buttons. I keep getting a syntax error when implementing the code, I have tried multiple variations of the following to attempt to figure out the syntax.
This works when typing in the actual tagpath Source=[’’+‘TagPath’+’’] or Source=[‘TagPath’]

Source=[’’+ system.tag.read([Client]Disp_Path) +’’]
Source=[’’+ {[Client]Disp_Path} +’’]

if({Alarm Count Label.states} = “”,

0,

toInt(runScript("len(system.alarm.queryStatus( Source=['*'+ {[Client]Disp_Path} +'*'], state=[" + 
left({Alarm Count Label.states}, len({Alarm Count Label.states}) - 1) +
"]))", {Alarm Count Label.UpdateRate}))

)

Thank you,
Martin

Good morning which of the answers was appropriate for what you needed, to add to my knowledge please?