Hi,
I have a Raspberry Pi Project which I am trying to test - however the retain variables do not seem to be working. I have read through the whole topic l viewtopic.php?f=21&t=5722&start=30#p20093 l , and according to the post below - If i run "sudo reboot now" - the variables set as RETAIN, should be retained after restart and I should see a file called Application.ret in the folder: /var/opt/codesys/PlcLogic/Application. The .ret file is not created and my variables set for RETAIN are reset to 0. If I create a new blank project with just one RETAIN variable - the file described above is created and the variable value is retained after performing the same sudo reboot.
One point to note is that my Codesys runtime is not yet licensed, as I am still testing to see if this is what I will use - could this be the issue?
Is anybody able to help with this? If necessary I can post a copy of the project (It is a modified copy of ths: https://github.com/MichielVanwelsenaere ... n.CoDeSys3).
Edwin Schwellinger hat geschrieben:
Hi,
beside the bootproject
runtime Directory
/PlcLogic/Application/
for the the Pi this:
/var/opt/codesys/PlcLogic/Application
Application.app
Application.crc
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
which versions are involved? ( runtime and CODESYS)
Could you check if there is any exception while shutdown - caused by this application?
Check the logger either by
tail -f /tmp/codesyscontrol.log
BR
Edwin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
we need your log while you are stoping/quit the runtime.... this snippet is the the restart of it.
I expect that there will be an application related exception which prevents the save of the retains.
BR
Edwin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There is no error in the log when I stop the service or when I restart the service manually:
I tried starting and stopping the service several times - there are no additional lines to the log after stopping the service.
Just did a bit more testing:
If I run the command "saveretains" (with PLC in stop) in the PLC Shell / Device tab, the retain file /var/opt/codesys/PlcLogic/HomeAutomation/HomeAutomation.ret is created successfully. If I reboot the Pi or stop / start the CODESYS service, the values from this snapshot are reloaded.
If I change any of the retain values and then reboot the Pi - a new version of the retain file is not created or updated, and the previous / old values are restored. No errors appear in the log regarding writing retain values.
Still no closer to a solution ...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
we see an exception caused by this retain vairiables declared in an fb.
It is still under investigation, no solution at the moment.
The workaround would be to use persistence manager instead of retains variables.
BR
Edwin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I have a Raspberry Pi Project which I am trying to test - however the retain variables do not seem to be working. I have read through the whole topic l viewtopic.php?f=21&t=5722&start=30#p20093 l , and according to the post below - If i run "sudo reboot now" - the variables set as RETAIN, should be retained after restart and I should see a file called Application.ret in the folder: /var/opt/codesys/PlcLogic/Application. The .ret file is not created and my variables set for RETAIN are reset to 0. If I create a new blank project with just one RETAIN variable - the file described above is created and the variable value is retained after performing the same sudo reboot.
One point to note is that my Codesys runtime is not yet licensed, as I am still testing to see if this is what I will use - could this be the issue?
Is anybody able to help with this? If necessary I can post a copy of the project (It is a modified copy of ths: https://github.com/MichielVanwelsenaere ... n.CoDeSys3).
Hi,
which versions are involved? ( runtime and CODESYS)
Could you check if there is any exception while shutdown - caused by this application?
Check the logger either by
tail -f /tmp/codesyscontrol.log
BR
Edwin
I am running CODESYS 3.5 SP15 Patch 1 and the "Target version" (shown when I connect) is 3.5.15.10.
Below is the output of the log:
Thanks
Hi,
we need your log while you are stoping/quit the runtime.... this snippet is the the restart of it.
I expect that there will be an application related exception which prevents the save of the retains.
BR
Edwin
Hi Edwin,
There is no error in the log when I stop the service or when I restart the service manually:
I tried starting and stopping the service several times - there are no additional lines to the log after stopping the service.
Only an error regarding retain restore when rebooting the pi:
Here is a link to an archive of the project in case that helps:
https://1drv.ms/u/s!AuoLjdHk1C3_hJxObMynRYwrdtMxgA?e=fBXAuI
Just did a bit more testing:
If I run the command "saveretains" (with PLC in stop) in the PLC Shell / Device tab, the retain file /var/opt/codesys/PlcLogic/HomeAutomation/HomeAutomation.ret is created successfully. If I reboot the Pi or stop / start the CODESYS service, the values from this snapshot are reloaded.
If I change any of the retain values and then reboot the Pi - a new version of the retain file is not created or updated, and the previous / old values are restored. No errors appear in the log regarding writing retain values.
Still no closer to a solution ...
Hi Edwin - do you have any idea why this isn't working or any further steps I can take to troubleshoot it?
Hi,
we see an exception caused by this retain vairiables declared in an fb.
It is still under investigation, no solution at the moment.
The workaround would be to use persistence manager instead of retains variables.
BR
Edwin