I use a UDT. Note: you’ll need to create a new Tag Group called ‘Area Alarms’. I set mine to direct 3000ms. You can ignore the Area PLCs for Alarm Reset tag.
{
"typeColor": -65536,
"readOnly": false,
"dataType": "Int4",
"writePermissions": {
"type": "AllOf",
"securityLevels": []
},
"name": "Area Alarms",
"readPermissions": {
"type": "AllOf",
"securityLevels": []
},
"tagGroup": "Default",
"tagType": "UdtType",
"enabled": true,
"tags": [
{
"valueSource": "expr",
"expression": "jsonGet({[.]Alarm Summary}, \u0027ActiveUnacked\u0027)",
"readOnly": false,
"dataType": "Int4",
"writePermissions": {
"type": "AllOf",
"securityLevels": []
},
"name": "Active Unack",
"executionMode": "TagGroupRate",
"readPermissions": {
"type": "AllOf",
"securityLevels": []
},
"tagGroup": "Area Alarms",
"tagType": "AtomicTag",
"enabled": true
},
{
"valueSource": "memory",
"readOnly": false,
"dataType": "DataSet",
"writePermissions": {
"type": "AllOf",
"securityLevels": []
},
"name": "Area PLCs for Alarm Reset",
"readPermissions": {
"type": "AllOf",
"securityLevels": []
},
"tagGroup": "Default",
"value": "{\"columns\":[{\"name\":\"PLCName\",\"type\":\"java.lang.String\"},{\"name\":\"PLCParentPathOverride\",\"type\":\"java.lang.String\"},{\"name\":\"DisableAlarmReset\",\"type\":\"java.lang.Boolean\"}],\"rows\":[]}",
"enabled": true,
"tagType": "AtomicTag"
},
{
"valueSource": "expr",
"expression": "runScript(\r\n\"shared.alarms.getAlarmSummary(\u0027\" + replace({PathToParentFolder}, \u0027Area Alarms\u0027, \u0027\u0027) + \"*\u0027)\"\r\n,2000\r\n)",
"dataType": "Document",
"name": "Alarm Summary",
"tagType": "AtomicTag"
},
{
"valueSource": "expr",
"expression": "jsonGet({[.]Alarm Summary}, \u0027ActiveAcked\u0027)",
"readOnly": false,
"dataType": "Int4",
"writePermissions": {
"type": "AllOf",
"securityLevels": []
},
"name": "Active Ack",
"executionMode": "TagGroupRate",
"readPermissions": {
"type": "AllOf",
"securityLevels": []
},
"tagGroup": "Area Alarms",
"tagType": "AtomicTag",
"enabled": true
},
{
"valueSource": "expr",
"expression": "runScript(\r\n\"system.dataset.toDataSet([\u0027source\u0027, \u0027name\u0027],[[str(a.source).split(\u0027:\u0027)[3], a.name] for a in system.alarm.queryStatus(priority\u003d[1,2,3,4], state\u003d[\u0027ActiveUnacked\u0027], path\u003d[\u0027*:/tag:\" + replace({PathToParentFolder}, {InstanceName},\u0027\u0027) + \"*\u0027])])\"\r\n\r\n, 2000\r\n)",
"dataType": "DataSet",
"name": "Active Unack Alarms",
"tagType": "AtomicTag"
}
]
}