# Resetting a tag value at certain day and time of the week

**URL:** <https://forum.inductiveautomation.com/t/resetting-a-tag-value-at-certain-day-and-time-of-the-week/65226>\
**Category:** Ignition\
**Created:** [October 14, 2022, 12:17pm UTC](https://forum.inductiveautomation.com/t/resetting-a-tag-value-at-certain-day-and-time-of-the-week/65226 "2022-10-14T12:17:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![M\_W\_R](https://avatars.discourse-cdn.com/v4/letter/m/d6d6ee/32.png) [@M\_W\_R](https://forum.inductiveautomation.com/u/M_W_R)\
**Post date:** [October 14, 2022, 12:17pm UTC](https://forum.inductiveautomation.com/t/resetting-a-tag-value-at-certain-day-and-time-of-the-week/65226/1 "2022-10-14T12:17:00Z")

</div>

Hello,

I am quite unfamiliar with the Python language but am looking for some help with an issue I am having. I am currently using Ignition V 8.1.15 to trend and report values for tags but need to reset a tag every Monday morning at 8:00 AM EST. I am not sure where or how this script would be set up or where it should be ran. Any help would be appreciated!

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [October 14, 2022, 12:18pm UTC](https://forum.inductiveautomation.com/t/resetting-a-tag-value-at-certain-day-and-time-of-the-week/65226/2 "2022-10-14T12:18:59Z")

</div>

Try a Gateway Scheduled Script: [Gateway Event Scripts - Ignition User Manual 8.1 - Ignition Documentation](https://docs.inductiveautomation.com/display/DOC81/Gateway+Event+Scripts#GatewayEventScripts-GatewayScheduledScripts)

---

<div class="post-metadata">

**Author:** ![M\_W\_R](https://avatars.discourse-cdn.com/v4/letter/m/d6d6ee/32.png) [@M\_W\_R](https://forum.inductiveautomation.com/u/M_W_R)\
**Post date:** [October 14, 2022, 12:28pm UTC](https://forum.inductiveautomation.com/t/resetting-a-tag-value-at-certain-day-and-time-of-the-week/65226/3 "2022-10-14T12:28:24Z")

</div>

The issue is that I am not sure how the write the script that is going to run at that time.

I need to write a value of 1 to a tag "ns=1;s=[PFI\_HOUSING\_H2O]TestTag" at 8:00 AM and then 5 seconds later write a value of 0 to this same tag.

---

<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 14, 2022, 12:33pm UTC](https://forum.inductiveautomation.com/t/resetting-a-tag-value-at-certain-day-and-time-of-the-week/65226/4 "2022-10-14T12:33:16Z")

</div>

Don't use a boolean trigger. Use a short integer. Increment it (allowing rollover) to make the PLC act. No reset required.

I generally make such triggers skip zero so that a zero can be a non-triggering PLC start-up value.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [October 14, 2022, 2:09pm UTC](https://forum.inductiveautomation.com/t/resetting-a-tag-value-at-certain-day-and-time-of-the-week/65226/5 "2022-10-14T14:09:34Z")

</div>

> [@M\_W\_R](#):
>
> I need to write a value of 1 ... and then 5 seconds later write a value of 0 ...

In case Phil's logic isn't clear, your method will fail if there is a 5 s glitch in communications. Phil's will work and, even better, the PLC can calculate how many pulses it missed, if required.
