# Best Practise For Constant Updating Scripts

**URL:** <https://forum.inductiveautomation.com/t/best-practise-for-constant-updating-scripts/68992>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [January 25, 2023, 6:02am UTC](https://forum.inductiveautomation.com/t/best-practise-for-constant-updating-scripts/68992 "2023-01-25T06:02:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul\_Krielen](https://avatars.discourse-cdn.com/v4/letter/p/5fc32e/32.png) [@Paul\_Krielen](https://forum.inductiveautomation.com/u/Paul_Krielen)\
**Post date:** [January 25, 2023, 6:02am UTC](https://forum.inductiveautomation.com/t/best-practise-for-constant-updating-scripts/68992/1 "2023-01-25T06:02:12Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [January 25, 2023, 1:26pm UTC](https://forum.inductiveautomation.com/t/best-practise-for-constant-updating-scripts/68992/2 "2023-01-25T13:26:24Z")

</div>

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.

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

```

[runScript - Ignition User Manual 8.1 - Ignition Documentation (inductiveautomation.com)](https://docs.inductiveautomation.com/display/DOC81/runScript)

---

<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:** [January 25, 2023, 1:28pm UTC](https://forum.inductiveautomation.com/t/best-practise-for-constant-updating-scripts/68992/3 "2023-01-25T13:28:34Z")

</div>

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.

---

<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:** [January 25, 2023, 1:29pm UTC](https://forum.inductiveautomation.com/t/best-practise-for-constant-updating-scripts/68992/4 "2023-01-25T13:29:48Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [January 25, 2023, 1:29pm UTC](https://forum.inductiveautomation.com/t/best-practise-for-constant-updating-scripts/68992/5 "2023-01-25T13:29:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [January 25, 2023, 1:35pm UTC](https://forum.inductiveautomation.com/t/best-practise-for-constant-updating-scripts/68992/6 "2023-01-25T13:35:43Z")

</div>

[https://docs.inductiveautomation.com/display/DOC81/Style+Classes#StyleClasses-AnimatedStyleClasses](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

> **[CSS Animations](https://www.w3schools.com/css/css3_animations.asp)**
>
> W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.
