# How to change gateway script timer timeout

**URL:** <https://forum.inductiveautomation.com/t/how-to-change-gateway-script-timer-timeout/2315>\
**Category:** Ignition\
**Created:** [November 3, 2010, 3:08am UTC](https://forum.inductiveautomation.com/t/how-to-change-gateway-script-timer-timeout/2315 "2010-11-03T03:08:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robert](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@Robert](https://forum.inductiveautomation.com/u/Robert)\
**Post date:** [November 3, 2010, 3:08am UTC](https://forum.inductiveautomation.com/t/how-to-change-gateway-script-timer-timeout/2315/1 "2010-11-03T03:08:39Z")

</div>

I need some syntax help here.

I have created a gateway timer script that toggles a control if there are unacked alarms.  
The customer wants a one hour timeout to allow someone time to ack the alarm before I toggle the control again.

What I came up with was:

`if (any_alarms) :
    toggle_control
    event.source.delay = 60 * 60 * 1000
else :
    event.source.delay = 5000`

The problem is the [tt]event.source.delay = x[/tt] doesn’t seem to work. What should it be?

---

<div class="post-metadata">

**Author:** ![nathan](https://avatars.discourse-cdn.com/v4/letter/n/c5a1d2/32.png) [@nathan](https://forum.inductiveautomation.com/u/nathan)\
**Post date:** [November 3, 2010, 4:52pm UTC](https://forum.inductiveautomation.com/t/how-to-change-gateway-script-timer-timeout/2315/2 "2010-11-03T16:52:05Z")

</div>

You could also use the database to store the date/time or time elapsed. I would use the alarm table to get this info, adding a column if necessary. The gateway script would periodically check and perform said action after the hour has elapsed for a given alarm.

---

<div class="post-metadata">

**Author:** ![Robert](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@Robert](https://forum.inductiveautomation.com/u/Robert)\
**Post date:** [November 3, 2010, 8:34pm UTC](https://forum.inductiveautomation.com/t/how-to-change-gateway-script-timer-timeout/2315/3 "2010-11-03T20:34:35Z")

</div>

True, but that adds more logic to the script and adds dependencies. I was able to do this to a client timer. Is there some reason I can’t do the same thing with a gateway timer?

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [November 4, 2010, 9:43pm UTC](https://forum.inductiveautomation.com/t/how-to-change-gateway-script-timer-timeout/2315/4 "2010-11-04T21:43:28Z")

</div>

No, you can’t do that. Client timer components aren’t anything like the gateway/client timer scripts. Their delay isn’t adjustable, sorry.

---

<div class="post-metadata">

**Author:** ![Robert](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@Robert](https://forum.inductiveautomation.com/u/Robert)\
**Post date:** [November 4, 2010, 10:59pm UTC](https://forum.inductiveautomation.com/t/how-to-change-gateway-script-timer-timeout/2315/5 "2010-11-04T22:59:12Z")

</div>

I guess I’ll implement Nathan’s suggestion then.
