Read all alarm metrics data in one binding

Hi all,

I am trying out 8.3 and I’m wondering whether there is a way to read all properties of an Alarm Metrics instance or not.

Obvisouly, with some tests on my end this does not seem doable as it appears you have to specify which property you want to subscribe to in order to get actual data

Sadly, for my use case I need to get two properties of the Alarm Metrics (highestActivePriority and highestUnackedPriority) , is there no way other than creating 2 bindings on every view where I want to show a border related to Alarm metrics?

For instance, if you specify the path of an instance, you can get the value of all the variables as a dictionary. This does not seem to behave the same for Alarm Metrics.

Hi @Samuel_Sueur,
You could use expression instead with tag()

Regards

This is generally a bad idea anyway, so not recommended. Creating bindings to more tags than you are using is just reducing your scalability and putting unnecessary load on the gateway. It’s the same issue with binding to UDT instances

1 Like

Under no circumstances should you use tag() in a UI binding. Full stop.

5 Likes

Hi @pturmel, @nminchin,

I never say that this was the perfect solution.

But this save me some headache in a few occasion.

Don't do it. There is nothing tag() does that cannot be done with a UI custom property that has an indirect tag binding. Using tag() in a UI binding may seem like a solution, but you are setting up yourself (or your successor) for misery. Let me rephrase:

Do not use tag() in any UI binding. Full stop.

I understand that, i just then have difficulties to see where that expression could be useful then?

The tag() expression function is useful and appropriate in gateway Expression Tags.

Makes sense, thanks for the explanation

Create two custom tags and do the bindings on each of those then use those wherever you need as an expression binding. It's simple and it works and it's a lot less overhead than you expect.

Two tags or two custom properties ?

Why not just... one expression binding?
{path/to/tag.Alarm Metrics.highestActivePriority} > 2 || {path/to/tag.Alarm Metrics.highestUnackedPriority} > 2 (or whatever).

Hi Paul,

Thanks for your suggestion.

My bad, in my screenshots I showed a direct tag binding, but what I am looking for is really an indirect tag binding, as the view would generally have a path parameter in input.

I guess what I’m after isn’t really doable so I’ll just have to create two indirect tag bindings in order to show a blinking alarm border or not depending on the alarm metric properties and whether there are unacked alarms or not.

1 Like

I reckon I raised a feature request for this, or similar. I wanted a status enum which basically told you if there were, in order of precedence: active unack, active ack, cleared unack, or no alarms in a single integer enum value, so I could use it to do what you’re trying to do without having to bind to two tags like we currently have to. I have this in my pre 8.3 alarm metrics tag udt