×
Siemens Industry Online Support
Siemens AG
Entry type: FAQ Entry ID: 23596519, Entry date: 08/17/2006
(2)
Rate

Retentivity behavior of S7-400 CPUs and the CPU 318-2 CPUs

  • Entry
  • Associated product(s)

 
Description:
The retentivity behavior of the separate variables is important for developers when creating programs. Developers usually have variables in their programs, whose contents are to be retained even during POWER OFF (retentive) and other variables that then have to be reset to a defined value (non-retentive). In SIMATIC STEP 7 developers can therefore configure retentive address areas for data, markers, S7 timers and S7 counters which can they can then use for the retentive variables. In this entry we describe the retentivity behavior of the address areas with SIMATIC S7-400 CPUs and the CPU 318-2 CPUs. The retentivity behavior of the address areas is described for the POWER OFF/ON change of status, the STOP/RUN operating mode and for overall reset.

The entry is divided into the following topics:

Conditions of the retentivity behavior

The behavior in operating mode STOP/RUN and at POWER OFF/ON depends on:

  • The CPU.
  • The use of battery, RAM memory card and FLASH memory card.
  • The parameterization in the HW Configuration.
  • The "Non-Retain" property set for each separate data block.

Program blocks and data blocks at POWER OFF/ON with/without buffer battery

The following points hold for program blocks and data blocks at POWER OFF/ON:

Without buffer battery:

  • S7-400 CPUs: If the program and data blocks in the main memory are not buffered by a battery, then the S7-400 CPU is completely reset after POWER OFF/ON. Then the runtime-relevant data blocks and program blocks are reloaded into the main memory from the FLASH memory card (if slotted).
    In the case of all data blocks the current values are reloaded from the load memory (FLASH memory card). If there are no current values in these data blocks in the load memory, then the initial values are loaded from the load memory.
  • CPU 318-2: If the program and data blocks in the main memory are not buffered by a battery, then they are lost after POWER OFF/ON. However, the values in the retentive address areas - as configured in the hardware configuration (see Table 03) - are retained. After POWER OFF/ON the runtime-relevant data blocks and program blocks are reloaded from the FLASH memory card (if slotted) into the main memory, whereby the values for retentive data block elements are taken from the retentive memory.
    In the case of non-retentive data blocks the current values are reloaded from the load memory (FLASH memory card). If there are no current values in these data blocks in the load memory, then the initial values are loaded from the load memory.
  • S7-400 CPUs: and CPU 318-2: Program and data blocks in the internal RAM load memory or on the RAM memory card are lost at POWER OFF/ON without buffer battery.

With buffer battery:

  • S7-400 CPUs: and CPU 318-2: If you use a battery, the program and data blocks are buffered in the main memory. They are retained after POWER OFF/ON.
    In the case of a parameterized warm start or restart after POWER ON there are no changes to the data block contents (restart only with S7-400).
    In the case of a parameterized cold start after POWER ON the current values of the data blocks are reloaded from the load memory. If there are no current values in these data blocks in the load memory, then the initial values are loaded from the load memory.
  • CPU 318-2: If you use a buffer battery, all the data blocks are buffered with CPU 318-2. All the values of the data blocks are retained at POWER OFF/ON.

Differences between overall reset and "POWER OFF/ON without buffer battery and without memory card" with CPU 318-2

In the case of "POWER OFF/ON without buffer battery and without memory card" the retentive areas remain unaffected with CPU 318-2. If the program is reloaded in this case, then it works with the old values from the retentive area. By default these are the first 8 counters, for example. This can lead to dangerous plant statuses if you don't take this into account.

Recommendation:
After a "POWER OFF/ON without buffer battery and without memory card" always do an overall reset.

Data, markers, S7 timers and S7 counters at POWER OFF/ON

The following Table 01 gives an overview of the retentivity behavior with data, markers, S7 timers and S7 counters in the various startup modes at POWER OFF/ON.
 

Startup mode

POWER OFF/ON

Cold start
  • All markers, S7 timers and S7 counters are deleted.
  • The current values of the data blocks are reloaded from the load memory. If there are no current values in these data blocks in the load memory, then the initial values are loaded from the load memory.
Warm start
  • All retentive markers, S7 timers and S7 counters are retained.
  • All non-retentive markers, S7 timers and S7 counters are deleted. (In the case of an unbuffered 400-series CPU the retentive markers, S7 timers and S7 counters are also deleted.)
  • In the case of retentive data blocks ("Non-Retain" disabled) the values are retained.
  • In the case of non-retentive data blocks ("Non-Retain" enabled) the current values are reloaded from the data blocks in the load memory. If there are no current values in these data blocks in the load memory, then the initial values are loaded from the load memory.
Restart
(only S7-400)
  • All markers, S7 timers and S7 counters are retained.
  • The values are retained for all data blocks.
  • It is only possible to restart the CPU in buffered status.
Table 01

Data, markers, timers and counters with the STOP/RUN operating mode

The following Table 02 gives an overview of the retentivity behavior with data, markers, S7 timers and S7 counters in the various startup modes with the STOP/RUN operating mode.
 

Startup mode

STOP/RUN operating mode

Cold start
  • All markers, S7 timers and S7 counters are deleted.
  • The current values of the data blocks are reloaded from the load memory. If there are no current values in these data blocks in the load memory, then the initial values are loaded from the load memory.
Warm start
  • All retentive markers, S7 timers and S7 counters are retained.
  • All non-retentive markers, S7 timers and S7 counters are deleted.
  • In the case of retentive data blocks ("Non-Retain" disabled) the values are retained.
  • In the case of non-retentive data blocks ("Non-Retain" enabled) the current values are reloaded from the data blocks in the load memory. If there are no current values in these data blocks in the load memory, then the initial values are loaded from the load memory.
Restart
(only S7-400)
  • All markers, S7 timers and S7 counters are retained.
  • The values are retained for all data blocks.
Table 02

Configuring retentive address areas in SIMATIC STEP 7

The following Table 03 describes how to proceed to configure retentive address areas.
 

No. Procedure
1 Open the Hardware Configuration of your S7-400 station (or CPU 318-2). Double-click on the icon of your CPU --> The "Properties - CPU 41x ..." window opens.


Fig. 01

 
2 Select the "Retentive Memory" tab.


Fig. 02

 
3 In the "Retentive Memory" tab, in the "Retentivity" field you can configure the retentive address areas for:
  • Markers
  • S7 timers
  • S7 counters

Only CPU 318-2: In the "Areas" field you can also define the retentive areas in data blocks. The "Non-Retain" property of the data blocks is not supported by CPU 318-2.

Warning:
Please make sure that your data blocks defined as retentive are available in the CPU 318-2 and are not too short.


Fig. 03

 
4 After configuring the desired retentive areas you can quit the CPU Properties dialog via "OK" or make changes in other tabs.
Table 03

Configuring retentivity behavior of data blocks in SIMATIC STEP 7

In S7-400 CPUs all the data blocks are preset to retentive. It is possible to disable retentivity individually for each data block. The following Table 04 describes how to set the retentivity behavior of a data block.
Warning:
The CPU 318-2 does not support the data block property "Non-Retain". However, the "Non-Retain" selection field is not disabled in STEP 7.
 

No. Procedure
1 Mark the data block for which you wish to change the "Non-Retain" property. In the menu bar you select "Edit > Object Properties..." or press the key combination [Alt] + [Return]. This opens the data block's "Properties..." window.


Fig. 04

 
2 In the "Properties..." dialog select the "General - Part 2" tab.


Fig. 05

 
3 When you enable the "Non-Retain" option, the data block is no longer retentive.


Fig. 06

 
Table 04

Overall reset

The following Table 05 gives an overview of the overall reset procedures.
 

 Overall reset with S7-400 and CPU 318-2
The following elements are deleted in the memory:
  • User program in the internal load memory (RAM)
  • User program on the RAM memory card (if slotted)
  • All markers, S7 timers and S7 counters
The following elements are retained:
  • Contents of the diagnostics buffer
  • Contents of the FLASH memory card
  • Time
  • Protection level set
  • Status and value of the elapsed time counter
Procedures after overall reset with slotted RAM memory card or without memory card:
  • Without FLASH  memory card the original MPI interface parameters are retained.
  • Since the complete user program has been deleted, you must transfer a new program.

Important:
If you wish to communicate with the CPU from your PG/PC after the overall reset, the only option you have for setting up this communication is via the MPI or MPI/DP interface.

Procedures after overall reset with slotted FLASH memory card:
  • If you have a flash memory card inserted, following the overall reset the CPU copies the user program and the system parameters saved on the flash memory card to the main memory.
    In the case of data blocks the current values are reloaded from the data blocks on the FLASH memory card. If there are no current values in these data blocks on the FLASH memory card, then the initial values are loaded from the load memory.
  • When the FLASH memory card is slotted the MPI parameters from the FLASH memory card are valid after the overall reset.
Table 05

Security information
In order to protect technical infrastructures, systems, machines and networks against cyber threats, it is necessary to implement – and continuously maintain – a holistic, state-of-the-art IT security concept. Siemens’ products and solutions constitute one element of such a concept. For more information about cyber security, please visit
https://www.siemens.com/cybersecurity#Ouraspiration.
Rate entry
no rating
Requests and feedback
What do you want to do?
Note: The feedback always relates to the current entry / product. Your message will be forwarded to our technical editors working in the Online Support. In a few days, you will receive a response if your feedback requires one. If we have no further questions, you will not hear from us.