Siemens SIMATIC S7-200 System Manual page 53

Programmable controller
Hide thumbs Also See for SIMATIC S7-200:
Table of Contents

Advertisement

Saving the Retentive M Memory Area on Power Loss
If you configured any of the first 14 bytes of bit memory (MB0 to MB13) to be retentive, these
bytes are saved to permanent memory when the S7-200 loses power. By default, the first 14
bytes of M memory are selected to be non-retentive.
Restoring Data after Power On
When power is applied, the S7-200 restores the program block and the system block from
permanent memory. The S7-200 then verifies that the super capacitor and optional battery
cartridge, if installed, has successfully maintained the data stored in RAM memory. If the data was
successfully maintained, the retentive areas of user data memory are left unchanged. The
non-retentive portions of V memory are restored from the contents of the data block in permanent
memory. The non-retentive portions of other memory areas are cleared.
If the contents of RAM were not maintained (such as after an extended power failure), the S7-200
clears all user data areas, sets the Retentive Data Lost memory bit (SM0.2), restores V memory
from the contents of the data block in permanent memory, and restores the first 14 bytes of
M memory from permanent memory if these bytes were previously configured as retentive.
Using Your Program to Save V Memory to Permanent Memory
You can save a value (byte, word, or double word) stored in any location of the V memory area to
permanent memory. A save to permanent memory operation typically increases the scan time by
10 to 15 ms. The value written by the Save operation overwrites any previous value stored in the
V memory area of permanent memory.
The save to permanent memory operation does not update the data in the memory cartridge.
Tip
Since the number of save operations to the permanent memory (EEPROM) is limited (100,000
minimum, and 1,000,000 typical), you should ensure that only necessary values are saved.
Otherwise, the EEPROM can wear out and the CPU can fail. Typically, you should perform save
operations at the occurrence of specific events that occur rather infrequently.
For example, if the scan time of the S7-200 is 50 ms and a value was saved once per scan, the
EEPROM would last a minimum of 5,000 seconds, which is less than an hour and a half. On the
other hand, if a value were saved once an hour, the EEPROM would last a minimum of 11
years.
Copying V Memory to Permanent Memory
Special Memory Byte 31 (SMB31) commands the S7-200 to copy a value in V memory to the
V memory area of permanent memory. Special Memory Word 32 (SMW32) stores the address
location of the value that is to be copied. Figure 4-17 shows the format of SMB31 and SMW32.
Use the following steps to program the S7-200 to
save or write a specific value in V memory:
1.
Load the V memory address of the value to
be saved in SMW32.
2.
Load the size of the data in SM31.0 and
SM31.1, as shown in Figure 4-17.
3.
Set SM31.7 to 1.
At the end of every scan cycle, the S7-200 checks
SM31.7; if SM31.7 equals 1, the specified value is
saved to permanent memory. The operation is
complete when the S7-200 resets SM31.7 to 0.
Do not change the value in V memory until the
save operation is complete.
PLC Concepts
SMB31
7
sv
0
0
0
0
0
s1
Save to permanent memory:
0 = No
1 = Yes
The CPU resets
SM31.7 after each
save operation.
SMW32
15
V memory address
Specify the V memory address as an offset from V0.
Figure 4-17 SMB31 and SMW32
Chapter 4
Size of value to be
0
saved:
s0
00 - - byte
01 - - byte
10 - - word
11 - - double word
0
39

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents