Indirect tag in Expression

Hi
Im trying to make a color scheme for alarm values i manage to use direct links but when i switch over to a indirect tag it will not work.

There are several variables i want to use so i cant manage it in a simple tag setup

Are there a way of using indirect tags in expression ?

There's a tag expression function that allows you to read an arbitrary tag path.
BUT it's usually recommended to avoid using it, because of performances issues.
I'll suggest two alternative methods:

  • create an intermediate custom property that will be just an indirect tag binding, and you can reference this in an expression. Use this if you need the same tag for several calculations.
  • If you're on perspective, you can use an indirect tag binding and then an expression transform, using {value} in the expression where you need the tag's value.

Hi
Im working in Perspective, could you expand on the last point ?

I have never gotten the expression transform to work, the code works in the Expression, but in the Tag->Expression it fails.

Because that's not an expression transform, that's an expression tag binding.
See the Add Transform button right below the fallback delay ? Click on this.

still the same fault

You need to go back to the basics.

Also, you're NOT doing what I suggested:

you can use an indirect tag binding and then an expression transform, using {value} in the expression where you need the tag's value.

that's not an expression transform, that's an expression tag binding.

I'll give you an example, but you really, REALLY need to learn the basics (and pay careful attention to what people tell you in their answers).
image

Now, you're using 2 tags. You can't pull the data from 2 tags in an indirect tag binding: it's used to build the path for just one tag.
So if both tag paths need to be dynamically built, use the first method I suggested: 2 custom properties with a single indirect tag binding each, and then you can use those props in an other expression:

One more things: If your tags can only take the values 0 and 1, they should probably be booleans instead of integers.

3 Likes

in the end i want to compare High and Low alarm settings towards the process value for the tag an sett colours for the different stages.
I have managed this fine with direct tags, but thats the problem, when i try to convert it to indirect tags in the Expression as i want to use it on several analog tags.

Im just using simple tags with simple values here to just solve the issue at hand,
Using Indirect tags in expression