Using "IF" in UDT OPCItemPath

We have a UDT with tags defined for 2 sets of three phase voltages (so a total of six items). The OPCItemPath is configured to use {Instance Name} and all works as intended. VA1, VB1, and VC1 are assigned to items 5,6,7 and VA2, VB2, and VC2 go to items 8,9,10.

However, have since come to learn that equipment is about 50/50 whether Vx1 is at 5,6,7 or 8,9,10 and vice versa for Vx2.

I can resolve this with two parameters - {VA Start Address} and {VB Start Address} but would prefer to use only one parameter if I can figure out how. But, because they flip-flop doing so requires (pseudo code):

If parameter = A then 5 else 8

or something along those lines in the OPCItemPath assignment. Anyone have a clever way of putting the equivalent of an IF statement into the OPCItemPath binding? Using latest version if it matters, see that there were some changes to OPCItemPath in 8.1.5.

I think you can have a script point at that property of the instance and write to it.

You could create dummy opc tags to the addresses and then use derived tags for your Vx1 Vx2 tags that use an expression to reference your dummy tags.

Writing to the opcitempath prop is certainly possible, but it’s more fraught with becoming out of sync and each time you change it you’ll get bad overlays until they come good.

1 Like

See, that’s why I ask. I can actually read the configuration from the equipment (at a fixed address :slight_smile:) so it doesn’t even need to be a parameter. Then the derived tags can be updated based on the value in that tag when they go online. Nice, and not too convoluted. I’ll probably have to do a fancy dance around not making the derived tags good until they’ve been assigned, but once I can get into expressions that’s not too hard.