Notifications
Clear all

Run a script when a variable changes?

3 Posts
3 Users
2 Reactions
32 Views
Posts: 2
Member
Topic starter
 

Hi everyone,

I need to run some JavaScript when a PLC value changes.

I could check the value every second with a timer, but I guess there is a better way for this. Is there an event I can use when the variable changes? Something like a "variableChanged" event or something similar?

Thanks!


 
Posted : 03/09/2026 4:00 pm CEST
Dominik
Posts: 27
Member Admin
 

Hi Sebi,

yes, you can assign a script directly to the OnVariableChanged event of a variable.

The script is only executed when the value changes, so you don't need a timer. You can also use the event arguments to access the new and previous value.


 
Posted : 09/09/2026 1:39 pm CEST
sebi.bruehl reacted
MarAlz-RW
Posts: 17
Member