Hi all,
I have a small issue related to initialChange.
Using if not initialChange: works perfectly in normal operation. However, our IT department reboots the Ignition VM about every two weeks for Windows updates or other maintenance. Unfortunately, this is company policy, so I cannot keep the server on a separate VM that they do not touch.
After every reboot, the first execution of every Tag Change Script is considered initialChange == True, so any script using if not initialChange: will not run on that first real value change.
Right now I see two possible solutions:
-
Manually trigger all required scripts after startup.
-
Add a Gateway Startup Script that performs a first "dry run" or initializes the tags so the next real change is not treated as the first execution.
The first option is not really practical because this is a large plant with thousands of Tag Change Scripts.
The second option works, but before I implement it everywhere I wanted to ask if there is a better or more standard approach.
Has anyone dealt with this issue in a large system? Is there a recommended pattern for handling initialChange after planned gateway/VM restarts?
For example, would it be better to:
-
Keep using
not initialChangeand add startup initialization logic? -
Use
previousValue.value != newValue.valueinstead? -
Store a separate "GatewayReady" memory tag and ignore
initialChangecompletely once the gateway is fully up? -
Or something else?
I only started noticing this because IT recently began rebooting the VM every two weeks. Before that, when it only happened once a year, it was not really a problem.
Thanks!