Cause of a Cold Start

The following table describes the different possible causes of a cold start.

Causes

Startup characteristics

Loading of an application

Cold start forced in STOP

Restore application from memory card, when the application is different from the one in internal RAM

Cold start forced in STOP or RUN mode as defined in the configuration

Restore application from memory card, with Control Expert commands PLC > Project backup > ....

Cold start forced in STOP. The start in RUN mode as defined in the configuration is not taken into account

RESET button pressed on supply

Cold start forced in STOP or RUN mode as defined in the configuration

RESET button pressed on supply less than 500ms after a power down

Cold start forced in STOP or RUN mode as defined in the configuration

RESET button pressed on supply after a processor error, except in the case of a watchdog error

Cold start forced in STOP. The start in RUN mode as defined in the configuration is not taken into account

Initialization from Control Expert

Forcing the system bit %S0

Start in STOP or in RUN (retaining the operating mode in progress at downtime), initialization only of application

Restoral after power supply outage with loss of context

Cold start forced in STOP or RUN mode as defined in the configuration

Illustration

The diagram below describes how a cold restart operates.

Operation

The table below describes the program execution restart phases on cold restart.

Phase

Description

1

The startup is performed in RUN or in STOP depending on the status of the Automatic start in RUN parameter defined in the configuration or, if this is in use, depending on the state of the RUN/STOP input.

Program execution is resumed at the start of the cycle.

2

The system carries out the following:

  • Deactivating tasks, other than the master task, until the end of the first master task cycle.

  • Initializing data (bits, I/O image, words etc.) with the initial values defined in the data editor (value set to 0, if no other initial value has been defined). For %MW words, the values can be retrieved on cold restart if the two conditions are valid :

    • the Initialize of %MW on cold restart option is unchecked in the processor’s configuration screen,

    • the internal flash memory has a valid backup (see %SW96).

    Note : If the number of %MW words exceeds the backup size (see the memory structure of M340 PLCs) during the save operation the remaining words are set to 0.

  • Initializing elementary function blocks on the basis of initial data.

  • Initializing data declared in the DFBs: either to 0 or to the initial value declared in the DFB type.

  • Initializing system bits and words.

  • Positioning charts to initial steps.

  • Cancelling any forcing.

  • Initializing message and event queues.

  • Sending configuration parameters to all discrete input/output modules and application-specific modules.

3

For this first restart cycle the system does the following:

  • Relaunches the master task with the %S0 (cold restart) and %S13 (first cycle in RUN) bits set to 1, and the %SW10 word (detection of a cold restart during the first task cycle) is set to 0.

  • Resets the %S0 and %S13 bits to 0, and sets each bit of the word %SW10 to 1 at the end of this first cycle of the master task.

  • Activates the fast task and event processing at the end of the first cycle of the master task.

Processing a cold start by program

It is advisable to test the bit %SW10.0 to detect a cold start and start processing specific to this cold start.

NOTE: It is possible to test the bit %S0, if the parameter Automatic start in RUN has been selected. If this is not the case, the PLC starts in STOP, the bit %S0 then switches to 1 on the first cycle after restart but is not visible to the program because it is not executed.

Output Changes

As soon as a power outage is detected, the outputs are set in the fallback position:

  • either they are assigned the fallback value,

  • or the current value is maintained,

depending on the choice made in the configuration.

After power restoral, the outputs remain at zero until they are updated by the task.