Iterative tag expression binding

I am trying to bind about 360 identical multi-state indicators to a series of iterative OPC tag data structures. In this case, the state of Indicator 1 would bind to an expression based off Tag 1/Item A and Tag 1/Item B, Indicator 2 binds to an expression with Tag 2/Item A and Tag 2/Item B, and so on (until Indicator 360 binds to Tag 360). Is there a way to set the expression based off the name of the component, rather than manually creating the expressions for all 360 indicators?

You can do this using UDT parameters.
Add a parameter called TagIndex, then just reference that in the OPC Item Path of the tag in the UDT.

Then you just create the tags based off the UDT and assign the TagIndex on the created tag.

I feel that I’m in a slightly different scenario. As a simpler example, I made a UDT called Test, with items TagA and TagB and parameter Index. There are then four instances of Test, where Index goes from 1 to 4.

In my main window, there are four numeric labels called Num1 through Num4 that take the sum of TagA and TagB. I use the property binding on the data value to make an expression for Num1. In this case, I was wondering if there was a way to substitute Test_1 in the property binding expression based on the data type parameter and label name? This way, Num1 could be copied to make Num2 through Num4 that would reference Test_2 through Test_4 respectively (instead of continuing to reference Test_1)

Create the expression tag inside of the UDT to do the calculation, then do a Template tied to the UDT where you can pass it any other calculations you want. Then you can use a template repeater or a template canvas to display as many of them as you want without having to draw and configure each one.

you should go through the Vision Templates course

Or you can use indirect addressing on the label controls to do the same.

1 Like

Looks like the Vision Templates course goes over what I’m trying to do. Thanks!