UDT Expression Tag with Alarm If statement to compare Tag Parameters and Tag

I have a bunch of UDT's set up for different device manufacturers. I would like to set up a umbrella Expression Tag to house all my alarms for each manufacturer UDT (would be better if I could do this above all UDT's if possible instead of for each manufacturer). For example, I am trying to set a High Voltage Alarm for several electrical meters. The problem is, I have multiple voltage ranges from 208V, 480V and 13.2kV, so I can't just say IF (Voltage Line > 480, true, false). This would enable alarms for the 208V meters and any meters that go above 480V. I thought I could add a UDT parameter "voltageRange" that I could use in an IF statement to check the above three voltages, then a second IF statement to set my condition above a high voltage setpoint to enable the alarm. But I cannot seem to get my expression code correct. Does anyone have any ideas how to get this to work? Please see images and description/code for how I have my Expression tag set up.

  1. UDT with "ELM_Alarm" Expression tag with "Value" set to {[~]} (This was to view any tag inside the UDT)
  2. High Voltage Alarm with "Alarm Mode Settings" set to "On Condition Mode" with "Is Active" set to IF ({[.]VLAvg}>0, IF ({[~]Parameters.voltageRange}=480, true, false)) (Please note I am trying to get my 480V meters to enable above VLAvg>0 just to test out the code)
  3. I am successful using IF ({[.]VLAvg}>0, true, false) on the individual UDT tag VLAvg, this enables alarms, but for all voltages mentioned above. So I feel my code referencing the voltageRange parameter is incorrect, or using the ELM_Alarm expression tag.

OK, so looking at this again, setting my "Value" of the Expression Tag ELM_Alarms to {[~]} as a string works with using IF ({[.]VLAvg}>0, true, false) this gets successful alarms enabled. But why doesn't using IF ({[.]Parameters.voltageRange}=480, true, false) work the same? I set a UDT parameter of voltageRange = 480 for a single meter.

Nor does this work,
IF ({[.]/Parameters.voltageRange}=480, true, false)
IF ({voltageRange}=480, true, false)

Ahhh-haaaaa! Got it to work!! See I just needed some of you to view my mubbling to get it to work, LOL!!!

SOLUTION
IF ({voltageRange}="480" && {[.]VLAvg}>0, true, false)

BUT..............

Can this be done above all UDT's? Please see image. Can it scan all UDT's below and enable alarms?
This doesn't seem to work when setting the Expression tag value:
{[.]../..}

There's no tag browse operation in the expression language. Any form of "scan" you wish to implement would have to be a script.

My first few original posts where inside a UDT, when using {[~]} for my Expresssion tag value, the High Voltage Alarm code IF ({voltageRange}="480" && {[.]VLAvg}>0, true, false) works perfectly and enables alarms.

Why won't this work above all UDT's using {[.]../..}, this was the path to the main UDT tag folder?

Even using {[~]} doesn't enable alarms either. In theory, this should work as this is the main folder for all my tags, both UDT and others. What gives?

Using {[.]} to point at the root of a UDT instance is a valid expression only because UDT instances will deliver the entire UDT as a Document. Folders don't do that.

You can simplify the expression to the example below, it will return a boolean naturally. Not a big deal, but a little cleaner.

{voltageRange}="480" && {[.]VLAvg}>0

I'm still confused what you're trying to do. You want a single tag to have a high voltage alarm that turns on whenever a bunch of voltage tags across multiple other UDT inctance go above certain voltages, based on the meters themselves?

If so, you should do the logic for the alarm within an expression tag within the indivudal UDT definitions, this will give you a bool alarm no alarm. Pass in the voltage high sp, or use a tag if there is one.

Then have an external expression tag that ORs the individual bools together. I don't think there's a nice way to dynamically bind this tag to a dynamic set of UDT instances