# Gateway Event Script Not Executing

**URL:** <https://forum.inductiveautomation.com/t/gateway-event-script-not-executing/63003>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [August 15, 2022, 3:18pm UTC](https://forum.inductiveautomation.com/t/gateway-event-script-not-executing/63003 "2022-08-15T15:18:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Keith\_Magill](https://avatars.discourse-cdn.com/v4/letter/k/85e7bf/32.png) [@Keith\_Magill](https://forum.inductiveautomation.com/u/Keith_Magill)\
**Post date:** [August 15, 2022, 3:18pm UTC](https://forum.inductiveautomation.com/t/gateway-event-script-not-executing/63003/1 "2022-08-15T15:18:57Z")

</div>

I am not sure why this is not executing properly.

I am looking to set a tag value when minute == 00.  
Eventually I will be setting it at 12:01 am to reset some PLC tag values.

I have been trying to use the Gateway event script with a "Setting "of: 00 Minutes.

The Script is:

```auto
def onScheduledEvent():
	meterresets = ["[default]Timetags/ResetMeters"]
	values = [0]
	system.tag.writeAsync(meterresets,values);
	print 'completed'

```

Is there something missing ??

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [August 15, 2022, 3:23pm UTC](https://forum.inductiveautomation.com/t/gateway-event-script-not-executing/63003/2 "2022-08-15T15:23:51Z")

</div>

Is the scheduled script enabled and what is your configuration for when it is supposed to run?

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [August 15, 2022, 3:23pm UTC](https://forum.inductiveautomation.com/t/gateway-event-script-not-executing/63003/3 "2022-08-15T15:23:57Z")

</div>

“Not executing properly” is very ambiguous; does the code not execute, or is there an error logged? We need to know what the incorrect behavior is before we can really provide insight into how to fix it.

---

<div class="post-metadata">

**Author:** ![Keith\_Magill](https://avatars.discourse-cdn.com/v4/letter/k/85e7bf/32.png) [@Keith\_Magill](https://forum.inductiveautomation.com/u/Keith_Magill)\
**Post date:** [August 15, 2022, 3:56pm UTC](https://forum.inductiveautomation.com/t/gateway-event-script-not-executing/63003/4 "2022-08-15T15:56:02Z")

</div>

I believe I found the issue.  
The incorrect project was referenced in the Gateway Settings under the “Gateway Scripting Project” field.

Once that way corrected, the script started working properly.

Thanks for your responses.

Another “Loose Nut at the Terminal” issue

---

<div class="post-metadata">

**Author:** ![Sameer\_Ambegaonkar](https://avatars.discourse-cdn.com/v4/letter/s/41988e/32.png) [@Sameer\_Ambegaonkar](https://forum.inductiveautomation.com/u/Sameer_Ambegaonkar)\
**Post date:** [July 4, 2024, 12:52am UTC](https://forum.inductiveautomation.com/t/gateway-event-script-not-executing/63003/5 "2024-07-04T00:52:12Z")

</div>

Got similar issue with scheduled gateway scripts not running. Gateway setting are correct. Scripting is correct and tested on another project.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [July 4, 2024, 6:19am UTC](https://forum.inductiveautomation.com/t/gateway-event-script-not-executing/63003/6 "2024-07-04T06:19:16Z")

</div>

You're gonna have to give us more details, we can't fix something we know nothing about.

Show us the script (see [how to post code](https://forum.inductiveautomation.com/t/wiki-how-to-post-code-on-this-forum/77831)) and the configuration of the event.  
If there are errors in the logs, show them too.
