Write value of a tag inside UDT in scripting

Hello how can i write value of Deliverydate tag which resides inside the Jobdetails UDT, via scripting? all i know is that this script here creates a tag with “tagname” but not sure how can i write value for the Deliverydate while creating this tag? Please help.

Thanks

Combining this post with your other post, am I understanding correctly that you are dynamically creating a UDT Instance for each Job in a database table? If so why? What is the purpose of storing it in a database if you’re also going to store it in tags?

Also, if that is the case, I think you need to take a step back, because I’m not sure that is really the direction you want to go. In other words…Don’t do that.

Now, on to the actual question of the post:

To write to the value of a tag you use system.tag.writeBlocking()

system.tag.writeBlocking(['path/to/tag/'],['value to write'])

I’m not sure why you’re showing a TagConfigure script. If you create (dynamically or otherwise) a UDTInstance it will have all of the members in the UDT Definition. You would then write the value of the tag as shown above.

If you haven’t yet you should watch the free videos at Browse the Lesson Library at Inductive University

Also, if you’re going to post screen shots of your scripts please also post pre-formatted text of the code (Use the </> button). It will help users to better help you.

1 Like