I've unsuccessfully been trying to use RETAIN variables within the HMI of a TM172DCLxxx.
Previously, I have tried to create them and tie them to buttons, resulting in the following error;
error G0096: RTN_XAUTORECOVERPOWER => Init value object not found
This variable previously worked when it was not a RETAIN type, hence scope was correct and no spelling issues. The HMI Properties window also automatically recognised the type, so it was actually finding the variable.
I further tried to define some without assigning to buttons; producing a total of three RETAIN variables, resulting in multiple of the following error type;
error A4100: RTN_USIARCONTROLMODE => Retentive vars space exhausted
Following this, I changed the type of two of them to standard variables to reduce the potential use of the retentive space, however the same error as above.
As far as I know, the TM172DCL display doesn't have "retain" memory area. The retain memory area would be an area that would be retained by the battery automatically without any user action.
However, the M172 family has was is called eeprom parameters. Those values are saved in flash memory. Because the way an eeprom chip works, there is a maximum of write operation in the life of an eeprom cell. It is around 100 000 write operation per memory cell. To preserve the life of an eeprom chip, the write to an eeprom parameter is not done automatically. It can be called from the program with the sysWritePar functions (one per data type, int, bool, etc). This function is smart and only actually writes to the memory cell if the actual value sent to the function is different then the actual value in the eeprom variable. This prevents a useless write operation to the memory.
Another way to write to an eeprom is from an HMI page. When an eeprom variable is mapped to a data entry object on a page, the value will be written to eeprom memory each time the value is changed by the user.