# Mimic Shelving/Ack using a script

**URL:** <https://forum.inductiveautomation.com/t/mimic-shelving-ack-using-a-script/8731>\
**Category:** Ignition\
**Created:** [July 15, 2014, 4:48pm UTC](https://forum.inductiveautomation.com/t/mimic-shelving-ack-using-a-script/8731 "2014-07-15T16:48:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![oxanemi](https://avatars.discourse-cdn.com/v4/letter/o/0ea827/32.png) [@oxanemi](https://forum.inductiveautomation.com/u/oxanemi)\
**Post date:** [July 15, 2014, 4:48pm UTC](https://forum.inductiveautomation.com/t/mimic-shelving-ack-using-a-script/8731/1 "2014-07-15T16:48:40Z")

</div>

I need a button which basically send the value 1 to a Memory Tag for a certain period of time, say 3 hours and after that resets it back to 0. (as to Acknowledge for a period of 3 hours)

A momentary button only works as long as the window is opened. What would be the best practice for such a requirement?

Thank You!

---

<div class="post-metadata">

**Author:** ![Luke.Stone](https://avatars.discourse-cdn.com/v4/letter/l/5fc32e/32.png) [@Luke.Stone](https://forum.inductiveautomation.com/u/Luke.Stone)\
**Post date:** [July 15, 2014, 9:30pm UTC](https://forum.inductiveautomation.com/t/mimic-shelving-ack-using-a-script/8731/2 "2014-07-15T21:30:13Z")

</div>

You could use a Gateway Timer script to check how long the value has been set to 1. How about this:

-Your button sets that memory tag to 1.  
-You create gateway timer script that runs once an hour and checks that tag, and if it’s true then it increments the value of another memory tag. The script also checks the value of that second memory tag and when that second memory tag’s value is 2, it writes 0 to both tags.

---

<div class="post-metadata">

**Author:** ![oxanemi](https://avatars.discourse-cdn.com/v4/letter/o/0ea827/32.png) [@oxanemi](https://forum.inductiveautomation.com/u/oxanemi)\
**Post date:** [July 17, 2014, 5:20pm UTC](https://forum.inductiveautomation.com/t/mimic-shelving-ack-using-a-script/8731/3 "2014-07-17T17:20:34Z")

</div>

Wonderful! Thank you! It worked!
