UDT- Alarms on boolean

I have a UDT with Product Level tag in it. I want to configure Alarms such that another expression tag in my UDT named "Active_Alarm" which shows me the name of Alarm activated. I used the following expression

if(isAlarmActive({[.]Product Level}, "HH"), "HH",
if(isAlarmActive({[.]Product Level}, "HA"), "HA",
if(isAlarmActive({[.]Product Level}, "LA"), "LA",
if(isAlarmActive({[.]Product Level},"LL"), "LL", "None"))))

I get "None" in my expression tag which is set to string.

I tried a double quotes method which gave me "Error Configuration"

I am stuck at this since 3-4 days. Anyone got tips?

Hi,

This won't work as when you are specifying {[.]Product Level} you are in reality specifying the value of the tag, not its tagpath.
The isAlarmActive expression function expects a tagpath as its first argument.

What you could do is specify the .path attribute, and maybe follow with a *wildcard.

Your expression would look like the below :

if(isAlarmActive({[.]Product Level.path} + "*", "HH"), "HH",
if(isAlarmActive({[.]Product Level.path} + "*", "HA"), "HA",
if(isAlarmActive({[.]Product Level.path} + "*", "LA"), "LA",
if(isAlarmActive({[.]Product Level.path} + "*","LL"), "LL", "None"))))

This is untested but should work.
Do not put your expression as "Event Driven", as the path of those tags does not change.
Let me know if it doesn't work, then I'll do some testing on my end.

I was stuck on this since a week :neutral_face: Thanks a bunch! It works

1 Like