Alarm Configuration Summary

I have many alarms that are defined at the UDT level and some can be enabled/disabled and delay adjusted by the operators as needed.

I would also like a way to provide the current alarm configuration for each alarm that could be active (i.e. whether it's enabled or not, what the current delay is, and what the alarm pipeline is).

This sounds like a job for a python script to iterate through every tag and create a table with the desired information, but I'm not exactly sure where to start. I also know that this will be a heavy task, but it will be run via pushbutton so not run very often.

Any tips would be much appreciated.

I think your best bet is to use the system.tag.query function (see the tag report tool), make sure to configure it to "Alarm(s) configured" (again you can use the tag report tool and copy the script and just paste it where needed).

From there, when doing it like so, you can loop through the results and use something like below:

# here the query argument for the function below 
# is the dictionary given by the tag report tool

		results = system.tag.query(provider, query)
		
		for tag in results:
			for alarm in tag["alarms"]:
				#here do whatever you want with your alarm

Doing so, you can then append your alarm to a list, then return the list and pass it to a Table component.

1 Like

I have been working on something like this and have run into a problem. I can not seem to determine the Mode of the alarm.

Here is a JSON string of an alarm:

{
    "setpointA": 2.0,
    "mode": {
        "properties": [
            {
                "displayKey": "AlarmModeProperties.single.setpointA",
                "bindable": true,
                "defaultVal": 0.0,
                "advanced": false,
                "descKey": "AlarmModeProperties.single.setpointA.Desc",
                "defaultValue": 0.0,
                "displayName": {
                    "defaultVal": "Setpoint",
                    "params": [
                    ],
                    "key": "AlarmModeProperties.single.setpointA"
                },
                "name": "setpointA",
                "description": {
                    "defaultVal": "The value used to initiate an alarm.",
                    "params": [
                    ],
                    "key": "AlarmModeProperties.single.setpointA.Desc"
                },
                "categoryKey": "enums.AlarmModeProperties.Category",
                "type": "class java.lang.Double",
                "category": {
                    "defaultVal": "Alarm Mode Settings",
                    "params": [
                    ],
                    "key": "enums.AlarmModeProperties.Category"
                }
            }
        ]
    },
    "notes": "This is a note",
    "timestampSource": {
        "intValue": 0
    },
    "ackMode": {
        "intValue": 0
    },
    "name": "Alarm 2",
    "ackNotesReqd": true,
    "label": "Alarm 2",
    "displayPath": "A path",
    "priority": {
        "intValue": 3
    },
    "enabled": false,
    "shelvingAllowed": false
}

There are a bunch of properties for the Alarm Mode but there is no actual mode. It should be "Below Setpoint" but I do not see anything to point me in that direction. The three parameters needed for a Below Setpoint alarm (Setpoint, Inclusive, Any Change) are defined. Anyone have an idea? TIA

I haven't exported this info, but is "setpointA" maybe the actual mode, but just not named intuitively? Have you tried setting up one for "Above Setpoint" to see what changes?

1 Like

Keep in mind that if you edit alarms within UDT instances the entire alarm will be overridden, which makes using UDTs someone useless.

Even if you edit manually the alarm will be overridden. The only way that I'm aware of to make this work is create tags outside of the alarm and bind these to the alarm props. Then you can edit those props manually or programmatically.

But those will only update on an alarm event. That is, if the alarm is inactive, and you change the a tag that a setpoint is bound to, the next alarm will be with the old setpoint.

If you want alarming on dynamic values, make a boolean expression tag that turns true at the appropriate time, and make that boolean your alarm.

1 Like

Really? I never bound to the setpoint, only props like priority, enable, acknowledge mode, etc. Those all worked just as expected.

You might want to go back and recheck some of your past stuff.

1 Like

You got me second guessing so I tested and I'm not seeing what you describe. Perhaps I'm missing something, so I will explain my situation...

  • Alarm is inactive
  • I change the priority
  • Trigger the alarm, alarm is active, the priority is correct
  • Clear the alarm, alarm is inactive
  • I change the priority
  • Trigger the alarm, alarm is active, the priority is correct

Perhaps the issue you described is only for the setpoint (or I'm not following what you said)?

How? Priority is bound to another tag and you change that tag?

Ah. It will only be an issue for things that factor into triggering the alarm. Enable and Setpoints, presumably.

Yes, this is actually PlantPax, so it's using expression on the severity PLC tag.

Not enable either, enable is also bound to a tag and while the alarm is active I can edit this tag as well and it updates. I don't ever bind to the setpoint since all of my alarms are BOOL and trigger high.

Hmmm. Tested it in a handy copy of 8.1.36 and it works as you describe. I wonder when that changed.

It it not. When I change the alarm to Bad Quality there are 0 parameters for the alarm mode.