Ignition Gateway Timer Scripts Writing to Memory Tags

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!

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 calls to debug the progress of your script. These will show up in the wrapper logs or gateway logs, respectively.

1 Like

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?

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.)

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

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. :slight_smile:

2 Likes

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

3 Likes

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

2 Likes