Expression into Indirect Tag Binding

Hi all,
I have Line Component in a Template which I would use the Visible Property depending of a two tag where path changes dynamically.

Planning to use an expression like:
Visible if {…/TTP01/…} AND {…/PPT01/…}

where TTP and PPT are between 01 to 20

I tried to use Indirect Tag Binding, but this doesn’t allow me to have more than one tag. Another solution was to use Expression Binding, but this doesn’t allow me to have dynamic reference or I don’t know how.

How to solve it?

thank you for the help!

Use two indirect bindings with custom properties to bring in the tag values, then use those custom properties in your final expression binding.

1 Like

You can also do tag() in an expression (have as many as you want),
https://docs.inductiveautomation.com/display/DOC79/tag

But, what Phil suggested should be considered best practice.

I can just imagine Phil’s mortified face reading that :grinning_face_with_smiling_eyes: like a graphic designer seeing a website done using Comic Sans

3 Likes

I resisted the urge to rant. :innocent:

3 Likes

Well since you replied… I think I was pretty clear what best practice was. I think it’s pretty clear the OP is new, so it’s appropriate to give him multiple options. No? I forget sometimes people can’t see outside the lines, when I said add as many as you want, I assumed I was talking to a normal audience. I think it’s better to say you can add as many as you want, vs only add 3! (which isn’t true) There is nothing wrong with using tag(). I have several projects still using them and they work fine. I make it a point to use custom properties, but let’s give the new guys as much info as possible and let them make their own choice, this isn’t Facebook or Twitter! :roll_eyes:

1 Like

Ah, but there is. It simply runs slower, because expressions built around it have to completely execute, even if only one little piece changes, and even if a given change wouldn’t yield a change in the output. Totally aside from the (fixed?) bugs in its implementation in v8.0.

Gateway expression tags are the only place the tag() expression function makes sense.

1 Like

What is the speed difference between a custom property and tag()? I’m not discounting what you say, but saying something is slower is subjective. For the typical user, is there going to be a problem and will they notice a difference? I sure can’t.

Property and expression bindings run entirely on the GUI thread. All bindings evaluate their arguments and at least deliver their results on the GUI thread. As long as you don’t max out the GUI thread, you won’t notice slower expressions and everything will appear to be fine. Whether that one thread is at 5% or 95%. Once you max it out and the GUI stalls, usability takes a dive. You obviously haven’t hit this yet, so my advice is easy to dismiss.

Carry on as you wish.

1 Like