[SOLVED] How to modify Alarm script on Navigation template to filter source

Ignition provides a template for the Navigation pane on the left. There is a small box that says something like ‘X alarms’ and blinks yellow. If you dig deep enough it gets its information from a script that gathers all alarms in the gateway. Is there a way to filter this script on the source only using wildcards?

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}))

)

I’ve tried inserting something like “source=TAGPROVIDER” after the state but I can’t quite get the syntax right and I’m not sure if the issue is syntax or I’m trying something impossible.

Any help is appreciated.

Solution:

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

0,

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

)

1 Like