SMB31 and SMW32 Write EEPROM
Special Memory Byte 31 and Special Memory Word 32 provide the capability for writing V-memory values to an EEPROM from the user program. To perform this function, load the address of the location to be saved in SMW32. Then, load SMB31 with the command to save the value. You do not change the value in V memory until the CPU resets SM31.7, indicating that the save operation is complete.
At the end of each scan, the CPU checks to see if a command to save a value to permanent memory was issued. If the command was issued, the specified value is saved to permanent memory.
SMB31 defines the size of the data to be saved to permanent memory and also provides the command that initiates the execution of a save operation. SMW32 stores the starting address in V memory for the data to be saved to permanent memory.
|Format||SMB31: Software command
|SMW32: V memory address
|SM31.0 and SM31.1||ss: Size of the value to be saved|
|00 = byte|
|01 = byte|
|10 = word|
|11 = double word|
|SM31.7||c: Save to permanent memory (EEPROM)|
|0 = No request for a save operation to be performed|
|1 = User program requests that the PLC save data to permanent memory.|
|The CPU resets this bit after each save operation.|
|SMW32||The V memory address for the data to be saved is stored in SMW32. This value is entered as an offset from V0. When a save operation is executed, the value in this V memory address is saved to the corresponding V memory location in the permanent memory (EEPROM).|