Passing parameters to UDT

I've forgotten how to do something I think I've accomplished before. I can't see how to pass a value from a UDT parent as a parameter in the nested UDT.

Can anyone give me a reminder? I haven't found a how-to in the manual or in the forum.


Maybe using the keyword this?

I don't think I've done what you are trying to do either.

If the source is a tag, you cannot. Or rather, you have to rely on a tag event script on the source to write to the peer UDT instance's parameter.

Hmm, yes. I've figured out that I can put {paramMachineId} as an expression in the nested UDT tag.
I need to rethink my strategy in the light of that.

Not sure what your full intent is, but I've created folders in parent UDTs with a number of tags that need to be written to child tags/parameters and a script trigger Boolean. When you manually set the Boolean true, its tag change script will write the parameters to their proper places in child tags and then write itself back to zero.

If you want it to update live, you may also be able to accomplish this with a tag change script on the elements in the parent tag themselves.

That's an interesting approach, thanks. I might try that.

Did you ever figure out a solution to this?

I recently published a resource that uses the technique I mentioned. It doesn't actually use nested UDTs, but the scripting could easily be modified for them.