# Restart tag via python script

**URL:** <https://forum.inductiveautomation.com/t/restart-tag-via-python-script/68225>\
**Category:** Ignition\
**Tags:** python, ignition81, scripting\
**Created:** [January 4, 2023, 4:35pm UTC](https://forum.inductiveautomation.com/t/restart-tag-via-python-script/68225 "2023-01-04T16:35:54Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![GeraldB](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/geraldb/32/36210_2.png) [@GeraldB](https://forum.inductiveautomation.com/u/GeraldB)\
**Post date:** [January 4, 2023, 4:35pm UTC](https://forum.inductiveautomation.com/t/restart-tag-via-python-script/68225/1 "2023-01-04T16:35:54Z")

</div>

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. 🙂

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

---

<div class="post-metadata">

**Author:** ![bmeyers](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmeyers/32/37453_2.png) [@bmeyers](https://forum.inductiveautomation.com/u/bmeyers)\
**Post date:** [January 4, 2023, 5:23pm UTC](https://forum.inductiveautomation.com/t/restart-tag-via-python-script/68225/2 "2023-01-04T17:23:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ethomason](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ethomason/32/43338_2.png) [@ethomason](https://forum.inductiveautomation.com/u/ethomason)\
**Post date:** [January 4, 2023, 5:30pm UTC](https://forum.inductiveautomation.com/t/restart-tag-via-python-script/68225/3 "2023-01-04T17:30:11Z")

</div>

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.

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

```

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [January 4, 2023, 5:34pm UTC](https://forum.inductiveautomation.com/t/restart-tag-via-python-script/68225/4 "2023-01-04T17:34:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![GeraldB](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/geraldb/32/36210_2.png) [@GeraldB](https://forum.inductiveautomation.com/u/GeraldB)\
**Post date:** [January 5, 2023, 9:57am UTC](https://forum.inductiveautomation.com/t/restart-tag-via-python-script/68225/5 "2023-01-05T09:57:32Z")

</div>

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 😀 ... and i know when it happend last.

I added the [request](https://ideas.inductiveautomation.com/ignition-features-and-ideas/p/scripting-restart-tags) to the ideas list.

---

<div class="post-metadata">

**Author:** ![Ryan\_Skiffington](https://avatars.discourse-cdn.com/v4/letter/r/4491bb/32.png) [@Ryan\_Skiffington](https://forum.inductiveautomation.com/u/Ryan_Skiffington)\
**Post date:** [August 22, 2024, 1:58am UTC](https://forum.inductiveautomation.com/t/restart-tag-via-python-script/68225/6 "2024-08-22T01:58:25Z")

</div>

How exactly did you do this? I have a UDT that uses Lookup expressions, when I change the Dataset used in the UDT Lookups it takes forever to update without doing a Tag/UDT Restart, Hoping to add code to Restart the UDT in the Dataset Update Script. (I like your request 26 idea)

---

<div class="post-metadata">

**Author:** ![SBL](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sbl/32/56813_2.png) [@SBL](https://forum.inductiveautomation.com/u/SBL)\
**Post date:** [October 3, 2024, 12:32pm UTC](https://forum.inductiveautomation.com/t/restart-tag-via-python-script/68225/7 "2024-10-03T12:32:24Z")

</div>

We are using system.tag.configure() to update UDT paramerers, but it seems to not trigger any update on the expression binding on the alarm display path. We need to restart the tag from the designer to update it.

Even if we change other parameters afterwards. Is this a bug? 🤔

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [October 3, 2024, 12:56pm UTC](https://forum.inductiveautomation.com/t/restart-tag-via-python-script/68225/8 "2024-10-03T12:56:33Z")

</div>

For alarm bindings, I'm not sure what pythonic event will cause them to refresh. They are only documented to be evaluated when an alarm event occurs.
