How to put a UDT variable in a script

Good Morning Everybody,

I know this is been answered a few times but do have some trouble understanding, so apologies in advance.

I need to read and write to UDT tags that I want to put into a script. The tags are under the "default" tag provider, and the UDT path would be something like Folder1, Folder2, Folder3, UDT instance, UDT tag.

I have had a look at the documentation online but still am having no luck. Any help with this would be great.

Thanks.

Did you look at system.tag.readBlocking and system.tag.writeBlocking?

The easiest way to get going on the UDT tag paths is to treat them like any other tag.

  • Go to the tag browser, find your UDT instance, expand as required, right-click on the required tag in your UDT structure and select Copy Path.
  • Paste that value into the list of tag paths in the functions @jlandwerlen has pointed you towards.

You can, of course, then modify the tag path by script with the machineId, or whatever.