Specifications
CPU Memory: Data Types and Addressing Modes
5-20
S7-200 Programmable Controller System Manual
C79000-G7076-C233-01
5.4 Using Your Program to Store Data Permanently
You can save a value (byte, word, or double word) stored in V memory to
EEPROM. This feature can be used to store a value in any location of the
permanent V memory area.
A save-to-EEPROM operation typically affects the scan time by up to 5 ms. The
value written by the save operation overwrites any previous value stored in the
permanent V memory area of the EEPROM.
Note
The save-to-EEPROM operation does not update the data in the memory
cartridge.
Copying V Memory to the EEPROM
Special Memory Byte 31 (SMB31) and Special Memory Word 32 (SMW32)
command the CPU to copy a value in V memory to the permanent V memory area
of the EEPROM. Figure 5-19 shows the format of SMB31 and SMW32. Use the
following steps to program the CPU 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. (See Figure 5-19.)
3. Set SM31.7 to 1.
At the end of every scan cycle, the CPU checks SM31.7; if SM31.7 equals 1, the
specified value is saved to the EEPROM. The operation is complete when the
CPU resets SM31.7 to 0. Do not change the value in V memory until the save
operation is complete.
7
0
MSB LSB
sv00000s1s0SMB31
Save to EEPROM:
0 = No
1 = Yes
Size of value to be saved:
00 - byte
01 - byte
10 - word
11 - double word
15
MSB LSB
SMW32
0
V memory address
Specify the V memory address as an offset from V0.
The CPU resets
SM31.7 after each
save operation.
Figure 5-19 Format of SMB31 and SMW32