SAVE_EEP$ strdata, addr |
Purpose | To store a string strdata in the user’s definable EEPROM address addr for non-volatile storage.
strdata - 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 allows you to save “strings” into the non-volatile data area of the PLC, which could be FRAM, FLASH, or EEPROM (legacy M-series PLCs only). This data 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 memory space and the remaining characters will be discarded. The string and integer data actually share the same pool of data space. However, the string spaces are allocated from the top of the data space downward, while the integer spaces are allocated from the bottom of the data 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. |