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.
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
system.tag.configure, there are some code examples you can use for inspiration.
Take care with using configure with getConfiguration though. Search the forum for posts by me on the subject
When you use system.tag.getConfiguration to get the configuration of UDt instances, it retrieves all non-default configuration of the UDT definition’s tags by deep recursively searching.
If you compare this to the Tag Browser’s copy JSON functionality, this only copies the properties of the UDT definition tags that are overridden at face value, as well as of the name and tagType.
When using getConfiguration with configure, the output from copy JSON is required otherwise you will essentially be…
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