I have a project on a raspberry pi 3. When reboot or turn of the raspberry, values of retain var are lost.
the codesys version is 3.5 sp16 patch 4.
The runtime raspberry is 18.104.22.168
I cheked in the application folder on raspberry,the .ret file dont exist.
if I issue the save command on the shell the file is created.
Without extra soft or hardware the Pi will never save retain variables out of its own.
Either a non volatile ram hardware (nvram) solution is needed. I have built a special library for an RTC chip which has also NVRAM support or you could use a working UPS (uninterruptable power supply) connected to the pi. Then the runtime store the retain data to a file on exit of Linux (a graceful shutdown is needed) and restore them on restart.
So without additional effort it won't work as the Pi has never been designed to support this via hardware.
Log in to post a comment.