Restart tag via python script

Hello,
I have a UDT definition with some calculated tags and some data tags from a device.
The calculated tags are scrap calculations, which are initialized with 0 when the tag is restarted.
So whenever i want to reset the calculation, I just restart the tag and that works fine. :slight_smile:

Is there a possibility to restart a tag with a python script like it can be done with a right-click on the tag?
Are there any other ways to restart tag with a script?

Thanks in advance for your help and ideas.
Best Regards,
Gerald

Is there a script running on the calculated tags? You could just write values to your data tags to "initialize" them.

I would try to write values as the poster above me suggested but if you absolutely must restart the tag it appears moving the tag then moving it back will restart it. Maybe someone from IA has a more elegant solution.

tagPath = ['[default]testCalcTag']
newPath = '[default]move/'
system.tag.move(tagPath, newPath)
system.tag.move([newPath], tagPath[0])

Consider trying system.tag.configure() and changing something inconsequential.

Thank you for your answers.

@bmeyers: Yes, there are scripts running on the calculated tags. It also came to my mind, but it is hard to maintain and must always be adopted when something changes.

@ethomason, @pturmel : I add a new tag property and store the restart timestamp -> that restarts the tag :grinning: ... and i know when it happend last.

I added the request to the ideas list.