Overview

A cold start is an initialization initiated by the Reset button of the power supply or the Cold start command in Control Expert.

The consequence of a cold start is the re-initialization of all the variables. They get their default values.

NOTE: After an application download the variables are reinitialized like a cold start.

CPU Cold Start Causes and States

Cold start causes and resulting CPU states:

Cause

Resulting CPU State

End of the application download.

STOP

Application restored from flash memory is different than the one in the non-persistent application RAM.

Use case:

  • application restored from a memory card if a compatible memory card is in the card slot

  • application restored from the CPU flash memory

STOP(1.)

Application restored from persistent memory with Control Expert command PLC > Project backup > .... is different than the one in the non-persistent application RAM:

  • application restored from a memory card if a compatible memory card is in the card slot

  • application restored from the CPU flash memory

STOP(1.)

Power supply RESET button pressed.

STOP(1.)

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

STOP(1.)

Power supply RESET button pressed after a CPU detected error, except in the case of a watchdog detected error (halt state).

STOP(2.)

Init requested with one of the 3 following means:

  • %S0 system bit set to 0

  • INIT request

  • Cold Start command in Control Expert

The CPU does not change its state. It only initializes the application.

It is a simulation of cold start.

Restoral after power down with a loss of context.

STOP(1.)

1. CPU state is set to RUN if Automatic start in Run option is selected.

2. Automatic start in Run option does not set the CPU to RUN state.

Loading or transferring an application to the CPU involves initialization of unlocated variables.

You need to assign a topological address to the data if the process requires keeping the current values of the data when transferring the application.

To save the located variables, avoid the initialization of the %MWi by unchecking Initialize %MWi on cold start parameter in the CPU configuration screen.

NOTE: Pressing the RESET button on the power supply resets %MWi and initial values are loaded.
NOTE: Do not press the RESET button on the power supply if you do not want %MWi to be reset and loaded with initial values.

Executing a Cold Start

Use these steps to perform a cold start:

Phase

Description

1

The startup is performed in RUN or in STOP state depending on one of the 2 following conditions:

  • The status of the Automatic start in Run parameter defined in the CPU configuration. If the parameter is selected, the start will be performed in RUN.

  • The state of the I/O defined in the Run/Stop input parameter in the CPU configuration.

Program execution is resumed at the start of the cycle.

2

The system carries out the following:

  • Disable FAST, AUX, and event tasks.

  • MAST task is executed until the end of data initialization.

  • Initialize data (bits, I/O image, words, and so on) 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 a cold start when these conditions are met:

    • The Initialize %MWi on cold start parameter is not checked in the CPU configuration screen,

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

    NOTE: If the number of %MW words exceeds the backup size during the save operation the remaining words are set to 0.
  • Initialize elementary function blocks (initial data).

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

  • Initialize system bits and words.

  • Position charts to initial steps.

  • Cancel any forcing action.

  • Initialize message and event queues.

  • Send configuration parameters to all I/O and application-specific modules.

3

To start a cycle, the system performs these tasks:

  • Relaunch the MAST task with the %S0 (cold start) and %S13 (first cycle in RUN) system bits set to 1. %SW10 (first cycle after cold start) system word is set to 0.

  • Reset the %S0 and %S13 system bits to 0 and set each bit of %SW10 system word to 1 at the end of this first cycle of the MAST task.

  • Activate the FAST and AUX tasks and event processing at the end of the first cycle of the MAST task.

Processing a Cold Start by Program

Test %SW10.0 system bit to detect a cold start and adapt the program consequently.

NOTE: It is possible to test the %S0 system bit on the first execution cycle if the Automatic start in RUN parameter is selected. If it is not selected, the CPU starts in STOP state and the bit %S0 switches to 1 on the first cycle after start (not visible for the program).

Output Changes

As soon as a power outage is detected the outputs are set in the fallback position configured (programmed fallback value or current value).

On power down, the outputs are not driven and remain at 0.

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