Help! It is posible to work with expressions and indirect tag?

Hi, I´m developing a project for the first time in Ingnition, so I’m learning it´s use. I watched the video for indirect tag binding, because I want to use similar tags from different instances, so it worked well. But the problem that i have is that, in that example it is only useful with one condition or tag.
For example I need an element to be visible depending of the states of two or more tags for diferent instances, so i need to use the expression binding, but when I try to make the expression, It displays some errors.

Based on the standard configuration:

It look like that, but as I said before, i need it to depend on more tags or conditions, so I tried to put this on the expression function like this:

{Sim_UDT_1/Analog_Valve_IT 1.Name_Position/MisMatchAcked} &&
{Sim_UDT_1/Analog_Valve_IT 1.Name_Position/MisMatchUnAcked}

But it was an error. Other way that I tried was to define the parameter, like this:

{Analog_Valve_IT 1.Name_Position} = {1}
{Sim_UDT_1/#1/MisMatchAcked} && {Sim_UDT_1/#1/MisMatchUnAcked}

But it neither worked. I tried in a lot of other ways, and I change the things that shows the message error but other problems continue. I think that the idea is clear with this 2 examples.

It is important to say that I´m doing this in the section of the Visible poperty editor component of the element, at the window of Property Binding/ Property/ Expression.
I think that maybe I have to define the parameter #1 in other place, but I don´t know where.
Please Help me, with this.
Thanks.

Check out the tag expression function.

Ewww! No!

Just make another string custom property, and bind it to as complex an expression as you need to yield the correct tag path. Or dynamic part of your tag path. Then point an indirect binding at that.
The expression on the string will basically be what you would have placed inside the tag() function’s parenthesis. The end result will execute faster and be easier to troubleshoot.

4 Likes

+1 for the easier to troubleshoot. With this method, it’s a lot easier to check out the intermediate value.

Hello, I’ve been having the same problem as the OP. I was curious if you could expand upon your explanation here. I don’t quite understand.

I’m trying to bind a button’s visibility bit to an indirect tag, but I need to take the inverse of a bit (make the button visible when the tag is 0). But the tag is indirectly addressed. So if I use the indirect tag binding, I can’t use a logic expression, and if I use the expression binding, I can’t use indirect addressing.

I’m not quite able to see how using another string property would help- would you mind dumbing it down for me?

If you have a working indirect tag that just needs to be inverted, you don’t need a custom string property. You need a custom boolean property, and move the entire binding there. Then the target property (visibility) gets an expression binding that inverts that boolean.

1 Like