Features, discussions, tips, tricks, questions, problems and feedback

*** The dangers of restarting a PC / Server when running a SCADA / Automation Project ***

In an ideal environment the automation engineer or system integrator has complete control over the restart of the PC / Server(s) on which the process is running. However, this is not always the case, whether it is through a forced Windows Update or a control issued from the IT department, the automation server may be at the mercy of actions that are out of their control.

A controlled shutdown means a shutdown that is triggered when the Server is stopped, and then waits for the process to exit gracefully.

Uncontrolled restart or shutdown of an automation server can lead to data loss or corruption.

Datalog files (especially large files) can be corrupted because the Agent Server process is killed, in other words, not through a controlled shutdown.
Configuration files (such as WGP) can corrupt because the Server is configured to “save on shutdown”, and cannot complete the save action before the process is killed.

Safeguard your system

  1. Ensure that “save on shutdown” is turned off for both the SmartUI Server and the Agent Server.
  2. Increase the period that Windows waits for a process to exit, before it is killed. (more info further down in this article)
  3. Invest in a UPS that will signal a power failure and ensure that a graceful shutdown can complete. A power failure can often result in corrupt files.
  4. Backup your configuration by using the built-in backup functionality. If a backup is normally done to a removeable device, ensure that the device is safely removeable before disconnecting the device.

These steps will ensure that there is a much lower risk of data corruption in the event of a system restart or shutdown.

3 Likes

To increase the period that Windows waits for a process to exit, the following registry keys can be used:

If running Agent Server as an application:

Regedit
Then navigate to: HKEY_CURRENT_USER\Control Panel\Desktop
Create new STRING value: WaitToKillAppTimeout if it does not exist yet
This key determines how long the system waits for user processes to shutdown, in milliseconds. The default is 20000.

If running the Agent Server as a service:

Regedit
Then navigate to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control
Create new STRING value: WaitToKillServiceTimeout if it does not exist yet
This key determines how long the system waits for services to shutdown, in milliseconds. The default is 20000.

2 Likes