I have been trying to get alarm areas from the system.alarm.queryStatus script. I have it working with a button on a screen with a custom property dataset and a integer with the following code.
ds = event.source.parent.getComponent(‘Tabs’).Dataset
results = system.alarm.queryStatus(Source=[“Loadout”], State=[“ActiveUnacked”])
ds = results.getDataset()
event.source.parent.getComponent(‘Tabs’).LoadoutAlmActive = ds.rowCount
but I really need it to work whenever there is a new alarm in the system to check for any new alarms in this “area” of my tag folder structure. So I thought the best place for that would be a GateWay Event Tag change script looking at “[System]Gateway/Alarming/Active and Unacked” to run the following script, but I am having problems getting the queryStatus script into a dataset that is not a custom property dataset. What would be the best way to do this?
results = system.alarm.queryStatus(Source=[“Loadout”], State=[“ActiveUnacked”])
ds = system.dataset.toDataSet(results)
system.tag.write(test,ds.rowCount)
Thanks for any input.