Using runScript in Gateway Expression Tag

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

ATTEMPTS:

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

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

2 Likes