Date/Time Tag from Scheduled Gateway Event


I am trying to create a script that writes the date/time to a tag at that scheduled event. Here's what I have but I keep getting "TypeError: expected a str".
I have tried the destination tagpath as both Date/time and String.

def onScheduledEvent():
rightNow =
nowTag = system.tag.readBlocking(['[default]plant/shift/shiftStartTime)'])

You don't need to read the tag to write to it

1 Like

system.tag.readBlocking() returns a list of QualifiedValues.

system.tag.writeBlocking() takes a list of tagPaths, and a List of values. As @dkhayes117 has shown.

To get the value read from a tag you need to get it from the list, and then refernece the value property of the QualifiedValue.


For what you're showing here, you don't actually need to read the tag though.

Unless there is some other logic you are wanting to perform.