Passing Tags to UDT parameters

I'm having problems passing a tag to a UDT parameter. I have a expression tag that calculated the OPC tag address. I then need to pass that tag as a UDT parameter to a OPC tag that reads it. If I use the following Syntax in an expression it will read the tag {[.]../Current_Value_Reg}. If I use this same syntax I get a null for the parameter value. I even tried typing out the full path with no luck. I have done this before on version 7.9.7. I'm currently using 8.1.42. Any ideas on what I'm doing wrong? Thanks.

This sounds like a rather weird thing to do, but anyway...

Try using a tagChange script on the Current_Value_Reg to write the parameter?

like so:

Nested_OPC_Path scripting:

def valueChanged(tag, tagPath, previousValue, currentValue, initialChange, missedEvents):
	if currentValue.value:
		system.tag.writeBlocking(['[.]Nested_Val/Parameters.path'], [currentValue.value])

works. I was able to replicate the null behavior you saw as well.

1 Like