IΒ΄m developing a hardware-project with CODESYS implementation and I need to ensure that the data on my PLC-hardware is saved in the case of a powerfail. I know that this works with a FRAM or a UPS and I have implemented both on my hardware. I want to use a real-time Linux OS and I have an ARM processor so I use the "CODESYS Control for Linux ARM" Runtime.
My question is how IΒ΄m able to adjust that the persistent variables are saved on the FRAM? Do I only have to adjust it in Linux and the Runtime communicates with it or do I have to adjust something in the Runtime settings so that persistent variables are getting a own address?
Thank you for your answers.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for your response @i-campbell. Unfortunately I wasnΒ΄t able to continue with my work until now.
I added the settings in my config file but there is no difference to before and the variables get written in the normal memory.
I tried it with writing in the CODESYSControl.cfg and in the CODESYSControl_User.cfg but in both cases it didn't work. After implementing the settings I rebooted the system and I tried different address areas (beginning of the NVRAM and somewhere in the middle of the NVRAM-address area).
Did I forget something?
Hello everyone,
IΒ΄m developing a hardware-project with CODESYS implementation and I need to ensure that the data on my PLC-hardware is saved in the case of a powerfail. I know that this works with a FRAM or a UPS and I have implemented both on my hardware. I want to use a real-time Linux OS and I have an ARM processor so I use the "CODESYS Control for Linux ARM" Runtime.
My question is how IΒ΄m able to adjust that the persistent variables are saved on the FRAM? Do I only have to adjust it in Linux and the Runtime communicates with it or do I have to adjust something in the Runtime settings so that persistent variables are getting a own address?
Thank you for your answers.
https://help.codesys.com/api-content/2/codesys/3.5.12.0/en/_cds_vartypes_retain_persistent/
"The requirement for full functionality is an appropriate memory range on the controller (NVRam, UPS)."
Not sure if that's possible
Last edit: djole01 2021-09-24
You need these settings in your config file
the address and size should match your actual NVRAM.
Thanks for your response @i-campbell. Unfortunately I wasnΒ΄t able to continue with my work until now.
I added the settings in my config file but there is no difference to before and the variables get written in the normal memory.
I tried it with writing in the CODESYSControl.cfg and in the CODESYSControl_User.cfg but in both cases it didn't work. After implementing the settings I rebooted the system and I tried different address areas (beginning of the NVRAM and somewhere in the middle of the NVRAM-address area).
Did I forget something?
My Code:
[CmpRetain]
Retain.SRAM.Size = 0x20000
Retain.SRAM.Address = 0x9A8E2A4
[CmpApp]
RetainType.Applications = InSRAM
How are you declaring your variables in your project?
https://help.codesys.com/webapp/_cds_setting_up_persistence;product=codesys;version=3.5.17.0
I'm declaring them exactly like explained in the file you mentioned...
But if I watch the usage of the memory in the development system, the size of the retain memory stays the same.