# Using runScript in Gateway Expression Tag

**URL:** <https://forum.inductiveautomation.com/t/using-runscript-in-gateway-expression-tag/20335>\
**Category:** Ignition\
**Tags:** ignition79, scripting\
**Created:** [October 23, 2018, 11:19pm UTC](https://forum.inductiveautomation.com/t/using-runscript-in-gateway-expression-tag/20335 "2018-10-23T23:19:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexanderfalinsky](https://avatars.discourse-cdn.com/v4/letter/a/91b2a8/32.png) [@alexanderfalinsky](https://forum.inductiveautomation.com/u/alexanderfalinsky)\
**Post date:** [October 23, 2018, 11:19pm UTC](https://forum.inductiveautomation.com/t/using-runscript-in-gateway-expression-tag/20335/1 "2018-10-23T23:19:54Z")

</div>

I am having a problem where I have setup an expression tag in the gateway that calls a function every few seconds:

runScript( “my\_func()”, 5 )

I want to run that every 5 seconds - though in reality this is tethered to another tag dynamically - but instead it runs based on the scan class, which is every 1 second. Is there a way to have this execute just using the runScript time?

I need to be able to change this for every tag, so I don’t want to have a scan class for every individual tag.

UPDATE:  
Just saw this: [https://docs.inductiveautomation.com/display/DOC/runScript](https://docs.inductiveautomation.com/display/DOC/runScript)

ATTEMPTS:

- Very slow scan class, so that my runScript will always get triggered when I want it to

---

<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 24, 2018, 1:24am UTC](https://forum.inductiveautomation.com/t/using-runscript-in-gateway-expression-tag/20335/2 "2018-10-24T01:24:37Z")

</div>

Expression tags ignore the repeat rate on runScript() or now(). Instead, they always run at the scan class rate.
