# Delay system.tag.write in component scripting

**URL:** <https://forum.inductiveautomation.com/t/delay-system-tag-write-in-component-scripting/18272>\
**Category:** Ignition\
**Created:** [June 3, 2018, 7:37pm UTC](https://forum.inductiveautomation.com/t/delay-system-tag-write-in-component-scripting/18272 "2018-06-03T19:37:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jshaffer09](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@jshaffer09](https://forum.inductiveautomation.com/u/jshaffer09)\
**Post date:** [June 3, 2018, 7:37pm UTC](https://forum.inductiveautomation.com/t/delay-system-tag-write-in-component-scripting/18272/1 "2018-06-03T19:37:23Z")

</div>

I want to delay a system.tag.write for 3 to 5 secs after a mouse click. I want to write a zero in to the tag.

---

<div class="post-metadata">

**Author:** ![witman](https://avatars.discourse-cdn.com/v4/letter/w/d2c977/32.png) [@witman](https://forum.inductiveautomation.com/u/witman)\
**Post date:** [June 3, 2018, 8:36pm UTC](https://forum.inductiveautomation.com/t/delay-system-tag-write-in-component-scripting/18272/2 "2018-06-03T20:36:59Z")

</div>

Wrap it in system.util.invokeLater in the actionPerformed event. Replace “[Client]testFloat” in code below with the actual path to your tag (right-click on tag in _Tag Browser_ and choose _Copy Tag Path_):

```python
# Define a function to call after a delay
def writeLater():
   import system
   system.tag.write("[Client]testFloat", 0)
# Tell the system to invoke the "writeLater" function after 3 seconds (3000 ms)
system.util.invokeLater(writeLater, 3000)

```

---

<div class="post-metadata">

**Author:** ![jshaffer09](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@jshaffer09](https://forum.inductiveautomation.com/u/jshaffer09)\
**Post date:** [June 3, 2018, 9:21pm UTC](https://forum.inductiveautomation.com/t/delay-system-tag-write-in-component-scripting/18272/3 "2018-06-03T21:21:58Z")

</div>

that worked great! thanks for the help

---

<div class="post-metadata">

**Author:** ![Rusty](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/rusty/32/19859_2.png) [@Rusty](https://forum.inductiveautomation.com/u/Rusty)\
**Post date:** [January 21, 2021, 10:48pm UTC](https://forum.inductiveautomation.com/t/delay-system-tag-write-in-component-scripting/18272/4 "2021-01-21T22:48:08Z")

</div>

Hello,

Can this work in a global script? I tried it and it doesn’t delay writing to the tag.

Thanks
