Reading and Writing Tag's UDT Parameters

Done some searching but I can't seem to get it working. Ignition 8.1

I have a bunch of tags based on a UDT and have a specific tag parameter that I'd like to read in and then modify via a script. Can anyone provide an example? I've been playing with readblocking, writeblocking and configure with little success.

In the tag browser, click on the UDT instance and then drill into the parameters. If you right click on a parameter and copy path this is the path that you can use in the read/writeBlocking.

1 Like

Tag property? It would help to know exactly what you're trying to read/write

Got it working with the help of the "copy path" thanks.

Any chance you know how I would change a value buried down a few layers in an actual UDT? I can pull down the whole JSON but can't figure how to manipulate a single value and write it back.

Copy Path works for UDT instance and definition tags as well. Just keep in mind that writing to a UDT instance tag will override that property in the instance.

UDT Definition tag paths will be prefixed with _types_/

Check out system.tag.configure, there are some code examples you can use for inspiration.
https://docs.inductiveautomation.com/display/DOC81/system.tag.configure

1 Like

Take care with using configure with getConfiguration though. Search the forum for posts by me on the subject

Eg

If you don't use getConfiguration you can side step the override issue, at least on tags, alarms is another story.

In this case without getConfiguration, make sure that the "merge" option is specified, otherwise you'll lose all other non-default configuration configured on the tags