I am currently working on a project on a Raspberry Pi and I need to use Persistent variables for the first time.
My question: When i declare my variable (lamp = output (see picture)) as persistent and I do a Cold Reset it stays true. But when I start my program again it becomes false. Does this have to do with some settings I haven't configured or can this be somthing else?
I am quite new to Codesys so any help is appreciated!
Retain/Persistent variables work that way:
On exit/shutdown for the runtime - these retain variables will be saved to a retain file.
On startup of the runtime they will be restored from that file.
If you have no UPS connected how should this work on just switching off the Raspberry Pi?
- there are only two options
1. use a UPS (which makes the whole Pi more robust against SD card corruption
2. an other option might be to use persistence manager from application composer
(https://content.helpme-codesys.com/en/CODESYS%20Application%20Composer/ac_pm_overview.html)
even here it would help to have UPS connected.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, I have Raspberry Pi 5 and I would like to use persistence manager too. But Codesys support said that Application Composer not compatibile with my runtime. Could you recommend a solution?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, I realized that if I replug the power supply the persistent variables lost their value with the new software too. Cold reset do not affect the variables value but hardware reboot still reset the values.
Application Composer can't be activated.
What is the solution?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello everybody,
I am currently working on a project on a Raspberry Pi and I need to use Persistent variables for the first time.
My question: When i declare my variable (lamp = output (see picture)) as persistent and I do a Cold Reset it stays true. But when I start my program again it becomes false. Does this have to do with some settings I haven't configured or can this be somthing else?
I am quite new to Codesys so any help is appreciated!
Mike
which device?
are they written on graceful shutdown?
I am using a Raspberry Pi 4.
What do you mean by a graceful shutdown?
Mike
Retain/Persistent variables work that way:
On exit/shutdown for the runtime - these retain variables will be saved to a retain file.
On startup of the runtime they will be restored from that file.
If you have no UPS connected how should this work on just switching off the Raspberry Pi?
- there are only two options
1. use a UPS (which makes the whole Pi more robust against SD card corruption
2. an other option might be to use persistence manager from application composer
(https://content.helpme-codesys.com/en/CODESYS%20Application%20Composer/ac_pm_overview.html)
even here it would help to have UPS connected.
Thank you, It worked using the persistence manager.
Hi, I have Raspberry Pi 5 and I would like to use persistence manager too. But Codesys support said that Application Composer not compatibile with my runtime. Could you recommend a solution?
which version of the runtime do you use?
I updated to 4.13.0.0 and now it works. Thank you!
Hi, I realized that if I replug the power supply the persistent variables lost their value with the new software too. Cold reset do not affect the variables value but hardware reboot still reset the values.
Application Composer can't be activated.
What is the solution?
no need to activate application composer. It is part of the licensefree part.
What do you mean it is part of the licensefree part?
I attached my error message.