I have a simple Startup script and Shutdown script to run in the Gateway, the startup script is fine but the shutdown script does not execute, my question is when does the shutdown script run? I’ve tried stopping and starting the Gateway service and also restarting the Gateway server itself, neither of which runs the shutdown script.
example
Startup script:
value = 1
system.tag.writeToTag(‘GatewayStatus’, value)
Shutdown script:
value = 0
system.tag.writeToTag(‘GatewayStatus’, value)
You know… it probably is running, but all the systems that need to be up and running in order to write to a tag have probably been shut down at the point that you’re script is executing.
Why don’t you verify this by just putting a print statement in there and looking in the wrapper.log file to see if it shows up.
you’re right it did run, so I guess I can’t write to a tag in a shutdown script?
also, I tested this in a VM and shutting down the Gateway correctly the shutdown script runs fine but I noticed if there is a power loss/unexpected shutdown that the shutdown script won’t run (which is what i’m trying to simulate) What else can I look for in the log to tell me if the gateway had an unexpected shutdown/power loss?
-We have an HMI that runs on battery backup (1 hour then it dies) if not plugged into power so I’m trying to find a way for us to know when a bad shutdown occurs…
-We have an HMI that runs on battery backup (1 hour then it dies) if not plugged into power so I’m trying to find a way for us to know when a bad shutdown occurs…
thanks[/quote]
monitor your ac power with a relay tied to a plc or modbus tcp io module using ignition. you can then have ignition log an alarm when the power goes down and even send you an email. obviously after the ups runs out you are dead.