SAVE_EEP
data, addr SAVE_EEP16 data, addr |
Purpose | Note: SAVE_EEP16 is
identical to the original SAVE_EEP. data
- may be a 16-bit integer constant or variable. This command stores a 16-bit integer datas in the users definable EEPROM or FRAM address "addr" for non-volatile storage. The actual PLC may have less EEPROM space. Please refer to your PLCs reference manual for the upper limit. If you attempt to save a 32-bit data, only the lower 16-bit will be saved. To save the entire 32-bit data, then:
Byte, Word and Long Word Addressing: Note that the EEPROM space for 8-bit, 16-bit and 32-bit SAVE_EEPXX and LOAD_EEPXX command are the same space and they are mapped as shown below
If you intend to use the EEPROM/FRAM space to store more than 1 type (8, 16 or 32-bit) of data then you must properly manage the EEPROM/FRAM data space reserved for storing each type of data so that they don't overwrite each other address space. The easiest way is always to reserve enough space for 32-bit data, followed by space reserved for 16-bit and/or 8 bit data. E.g. If you have 6000 words (16-bit) of FRAM space - this means you have space for storing 6000*2 = 12000 bytes of 8-bit data and you only have 6000/2 = 3000 long words for storing 32-bit data. Now assume that your program needs to store up to 500 x 32-bit data and the balance for storing 8 bit data. If you reserve 500 long words for 32-bit data, that means you are using up 500*4 = 2000 bytes of the FRAM space. This leaves you 12000 - 2000 = 10000 bytes of FRAM space for storing 8-bit data starting from byte address space 2001 to 12000. |
|||||||||||||||
Examples | save_EEP relay[1],100 | |||||||||||||||
See Also | LOAD_EEP( ), GETHIGH16( ), SETHIGH16, SAVE_EEP$ |