Leo, Are you talking about an Application Station running control modules in the virtual controller?
When the virtual controller restarts, it must load its control modules from the download files. During initialization of the modules, parameters will be set to their default values, unless there is some initialization to restore them to a more current value.
Typically, the virtual controller is used to hold data from external sources, or to perform supplementary calculations on process data where it is preferred that the controllers do not perform these calculations. We use the virtual controller mainly for integration with supervisory applications.
Unlike real controllers, the virtual controller does not have Non volatile Memory to preserve runtime values on a restart..
So is this particular module appropriate for the virtual controller or should it be run in a real controller?
Do you have any initialization logic that could set the MODE to the correct setting when the station restarts?
Is the Mode a value that comes from a remote OPC server?
If you can, add an initialization routine to the module such that when it restarts, it can determine what the correct mode should be and automatically set it. The default value and status of any parameters that need initializing should be set so that downstream logic does not take action until the values have been initialized. For instance the Status should be set to BAD as the default and then set to GOOD once the value has been initialised.
There are many ways to approach this, but the bottom line is that when the workstation restarts, it loads the modules from the download scripts and they will do exactly what you configure them to do.