LOAD_EEP32 (addr32)

Purpose To return a 32-bit integer data stored in the EEPROM/FRAM long word address "addr32".

addr32 -  Long Word address of EEPROM/FRAM .

Actual PLC may have less EEPROM space. Please refer to your PLC’s reference manual for the upper limit.


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

LOAD_EEP32 LOAD_EEP16 LOAD_EEP8
1 1 and 2 1, 2 3 & 4
2 3 and 4 5,6,7,8
... .. ..
N 2N-1 & 2N 4N-3, 4N-2, 4N-1, 4N

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 DM32[1] = LOAD_EEP32(10): A = LOAD_EEP32(2)
See Also SAVE_EEP, LOAD_EEP$, SAVE_EEP$

  backbutton.gif (507 bytes)  Basic to TBASIC Reference Manual