Purpose | To store a string strdata in the
user's definable EEPROM address addrdata - may be a 16-bit integer constant or variable. stringdata - may be any string constant or string variable. |
Examples | SAVE_EEP$ A$,3 |
Comments: | The content of A$ will be stored at string space #3 of data EEPROM |
See Also | LOAD_EEP$( ), GETHIGH16( ), SETHIGH16 |
Basic to TBASIC Reference Manual
Save_EEP$ Implementation on M+ PLC |
|
Save_EEP$ and
Load_EEP$ are two new TBASIC commands available only to the new F-series or the M+ PLC with firmware
revision r44 and above. These commands allow you to save 'strings' into the non-volatile
data EEPROM area of the PLC. The EEPROM space is divided into 40-byte chunks for string
storage. I.e. regardless of the length of the string, each string storage location will
occupy a fixed 40-character length. Hence if 'stringdata' parameter is longer 40
characters then only the first 40 characters will be stored in the EEPROM, the remaining
characters will be discarded. The string and integer data actually share the same pool of data EEPROM space. However, the string spaces are allocated from the top of the data EEPROM space downward, while the integer spaces are allocated from the bottom of the data EEPROM space and grow upward. This implementation allows say both SAVE_EEP n, 1 and SAVE_EEP$ x$, 1 to be executed in the same program without the string and integer data writing over each other space. However, when the addresses grow larger up to a certain point, the integer and string data space will cross path and overwrite each other's space. It is therefore the programmer's responsibility to check that this does not happen. Here is how:
To determine the upper limit of one type of storage, you have to first
decide how much space you want to allocate to the other type. |