# Ignition Gateway Timer Scripts Writing to Memory Tags

**URL:** <https://forum.inductiveautomation.com/t/ignition-gateway-timer-scripts-writing-to-memory-tags/70340>\
**Category:** Ignition\
**Tags:** scripting, ignition80\
**Created:** [February 27, 2023, 2:08am UTC](https://forum.inductiveautomation.com/t/ignition-gateway-timer-scripts-writing-to-memory-tags/70340 "2023-02-27T02:08:37Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thomas\_Hawkins](https://avatars.discourse-cdn.com/v4/letter/t/c37758/32.png) [@Thomas\_Hawkins](https://forum.inductiveautomation.com/u/Thomas_Hawkins)\
**Post date:** [February 27, 2023, 2:08am UTC](https://forum.inductiveautomation.com/t/ignition-gateway-timer-scripts-writing-to-memory-tags/70340/1 "2023-02-27T02:08:38Z")

</div>

Hi,

I am trying to run the script every minute, which grabs values from a webpage and the values are then written to the memory tags.

The script works fine in the Script Console, but when it's put in the Gateway Timer Scripts, the script runs as I can see it on live running scripts, but the tags are not changed. Just wondering any clues to resolve this?

Thanks!

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/e/aeb668abb29d360fc71d51c5bd18059c41f5b68a.png)

---

<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:** [February 27, 2023, 2:14am UTC](https://forum.inductiveautomation.com/t/ignition-gateway-timer-scripts-writing-to-memory-tags/70340/2 "2023-02-27T02:14:28Z")

</div>

When it runs in the script console it is executing on whatever computer is running the Designer.

When it runs in a gateway timer script it's executing on whatever computer is running the Ignition Gateway.

Perhaps there is a firewall issue or that server is simply not routable from the gateway. You can add print or [logging](https://docs.inductiveautomation.com/display/DOC81/system.util.getLogger) calls to debug the progress of your script. These will show up in the wrapper logs or gateway logs, respectively.

---

<div class="post-metadata">

**Author:** ![Thomas\_Hawkins](https://avatars.discourse-cdn.com/v4/letter/t/c37758/32.png) [@Thomas\_Hawkins](https://forum.inductiveautomation.com/u/Thomas_Hawkins)\
**Post date:** [February 27, 2023, 2:35am UTC](https://forum.inductiveautomation.com/t/ignition-gateway-timer-scripts-writing-to-memory-tags/70340/3 "2023-02-27T02:35:58Z")

</div>

There shouldn't be a firewall issue, and the gateway is set on the same machine as the designer, so that should not be an issue.

Is there other ways than using the gateway timer scripts to run scripts every few minutes?

---

<div class="post-metadata">

**Author:** ![nideyijuyidong](https://avatars.discourse-cdn.com/v4/letter/n/7cd45c/32.png) [@nideyijuyidong](https://forum.inductiveautomation.com/u/nideyijuyidong)\
**Post date:** [February 27, 2023, 2:50am UTC](https://forum.inductiveautomation.com/t/ignition-gateway-timer-scripts-writing-to-memory-tags/70340/4 "2023-02-27T02:50:04Z")

</div>

Try putting the script in the Scripts Library, and then call the method. See if you get an error calling this method from a designer view page.  
Just based on my experience, if a script can run in View, but not in the gateway, it means that there is something wrong with your script itself.(Maybe you have a bug with the processing of incoming parameters or something.)

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [February 27, 2023, 12:35pm UTC](https://forum.inductiveautomation.com/t/ignition-gateway-timer-scripts-writing-to-memory-tags/70340/5 "2023-02-27T12:35:35Z")

</div>

not your issue, but remove the exit(), you don't need it, and it's probably not good either

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [February 27, 2023, 12:46pm UTC](https://forum.inductiveautomation.com/t/ignition-gateway-timer-scripts-writing-to-memory-tags/70340/6 "2023-02-27T12:46:04Z")

</div>

Also keep in mind that the OS user running the gateway is-- more than likely-- _not_ the same OS user running the designer, even if it's on the same machine. I'd start with logging, as @Kevin.Herron suggested, and see what you have going on. 🙂

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [February 27, 2023, 4:59pm UTC](https://forum.inductiveautomation.com/t/ignition-gateway-timer-scripts-writing-to-memory-tags/70340/7 "2023-02-27T16:59:45Z")

</div>

Not to dogpile, but you also (_generally_) don't want to parse HTML with regex:

> <https://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454>

---

<div class="post-metadata">

**Author:** ![WillMT10](https://avatars.discourse-cdn.com/v4/letter/w/7feea3/32.png) [@WillMT10](https://forum.inductiveautomation.com/u/WillMT10)\
**Post date:** [February 27, 2023, 5:44pm UTC](https://forum.inductiveautomation.com/t/ignition-gateway-timer-scripts-writing-to-memory-tags/70340/8 "2023-02-27T17:44:59Z")

</div>

That is one of the best SO answers I've ever seen 😂
