# Write one tag twice (Fail)

**URL:** <https://forum.inductiveautomation.com/t/write-one-tag-twice-fail/58208>\
**Category:** Ignition\
**Tags:** ignition81, scripting\
**Created:** [April 8, 2022, 7:57am UTC](https://forum.inductiveautomation.com/t/write-one-tag-twice-fail/58208 "2022-04-08T07:57:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jason\_Hsu](https://avatars.discourse-cdn.com/v4/letter/j/ecb155/32.png) [@Jason\_Hsu](https://forum.inductiveautomation.com/u/Jason_Hsu)\
**Post date:** [April 8, 2022, 7:57am UTC](https://forum.inductiveautomation.com/t/write-one-tag-twice-fail/58208/1 "2022-04-08T07:57:15Z")

</div>

I’d like to write one tag twice, but the function isn’t works. When gateway tag change script be triggered, the tag value will change to 1, but can’t back to 0. Is there something wrong?

Version: 8.1.13  
The script is as below:

```auto
system.tag.write("Temp/ReplyBit", 1)
time.sleep(1) # Delay for 1 second
system.tag.write("Temp/ReplyBit", 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:** [April 8, 2022, 11:46am UTC](https://forum.inductiveautomation.com/t/write-one-tag-twice-fail/58208/2 "2022-04-08T11:46:31Z")

</div>

It is dangerous to use sleep. (Any kind of sleep or CPU burning wait-loop.)  
Use a timer event and a state machine, where state is kept in a separate tag. Consider using a datetime tag to hold a “turn off” deadline that the timer event can examine and act upon.

Let me repeat: _**Don’t use any kind of sleep().**_
