Best Practise For Constant Updating Scripts

I am developing a bunch of standard popups that will need constant updating of animations etc. There are too many variables (parameters) to individually call the update scripts (ie on value change) so I'm looking for a way to constantly update the whole animation cyclically. Typically there will be none or only 1 pop-up open as these will be for motor and valve diagnostics and manual controls etc.
Two ways I have tried that do work are:

  1. Have a param that references a boolean in the gateway that is set true/false every ~100ms. Tag value change calls a script local to the popup.

  2. Have a message cyclically called in the gateway. On the message being received in the popup the script will run.

Any thoughts about what will be the most efficient/low overheads or if there is a better way?

You could create a custom property to hold your animation data and use an expression binding using runScript. You can call a project script with it and specifiy a poll interval.

# execute script every 3000 ms with two arguments
runScript("animations.someScript", 3000, arg1, arg2)  

runScript - Ignition User Manual 8.1 - Ignition Documentation (inductiveautomation.com)

If you are using jython to animate Perspective, you are screwing up. There is no "low overhead" way to do that, as jython runs on the gateway. (Every little change has to travel from gateway to browser.)

There are numerous posts on this forum showing how to use CSS for animations. If you post more details, one of those experts might pop in here.

2 Likes

Actually, expression bindings run on the gateway, too. So, same applies.

I blew right pass CSS animations, yep that would definitely be the way to go.

https://docs.inductiveautomation.com/display/DOC81/Style+Classes#StyleClasses-AnimatedStyleClasses

if this does not provide enough flexibilty, you'll have to give more details or dive into the stylesheet and use css

1 Like