CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Thu Dec 13, 2018 4:52 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 48 posts ]  Go to page Previous 1 2 3 4 Next
Author Message
PostPosted: Tue Feb 07, 2017 8:32 am 
Offline

Joined: Thu Jun 16, 2016 2:57 pm
Posts: 20
Hello,

is there no other chance (expect UPS) to save some variables in case of power failure for a RaspberryPi system??

It works with a normal shutdown, but with a failure not.

Thanks for more informations


Top
   
PostPosted: Wed Feb 08, 2017 6:20 am 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 3015
Hi,
if you want to use the "VAR PERSISTENT RETAIN" with the Pi and a have reliable solution
then a UPS is a must have!
This makes the Pi more robust for the Problem 'SD card corruption caused by switch the power off' too.

Sure there are always semi-reliable solutions:

1. Save these Retains in the application via CmpApp (with this solution you do not have the latest retain state)
2. Save the values ​​via Sysfile - or Inifile writers from the CODESYS Store product
3. PersistenceManager of the Application Composer - this can store cyclic or on change variables (here you have to make a very precise decision for each individual variable, whether cyclic or to save changes and if cyclic which time makes sense! ))

Attention:
With all the three possibilities/solutions on the PI the one problem remain:
What happens on 'file writing' during switchoff - graceful shutdown on Linux is needed.
1. The file is not written correctly
2. SD card corrupt and Pi maybe does not come up again on bootup

That's the whole story ;-)


BR
Edwin


Top
   
PostPosted: Thu Oct 05, 2017 2:40 pm 
Offline

Joined: Thu Aug 03, 2017 8:56 am
Posts: 18
Hi all,
I have the same problem.
Has a solution been found?
Thanks, best regards


Top
   
PostPosted: Mon Oct 23, 2017 11:34 am 
Offline

Joined: Tue Sep 12, 2017 9:37 am
Posts: 77
Hello:
I have the system to retain variables that I keep in a file the variables and then at the beginning I retrieve them, it works correctly when I remove tension to the equipment but when I make a modification to the plc the variables no longer start correctly and they all start at 0, this has a solution

edit:

after several tests I see that I only lose the retain variables in some cases like when I create a manager trend, does anyone know which cases are lost?

thanks for help.


Top
   
PostPosted: Fri Nov 17, 2017 1:20 pm 
Offline
User avatar

Joined: Thu Jan 21, 2016 10:58 am
Posts: 32
Hello Edwin,

I have a DS1307 RTC Module for my Raspberry:
https://www.amazon.de/gp/product/B01FR7 ... UTF8&psc=1

There is a description how configure rpi not to lose the clock time:
https://cdn-learn.adafruit.com/download ... rry-pi.pdf

Is there any safe way or possibility with this RTC module to keep the retain variables of codesys after power loss?

Thanks,
Gergö


Top
   
PostPosted: Sat Nov 18, 2017 5:53 am 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 3015
Hi Gergö,
no this does only retain the clock, no additional Memory/space for storing variables.

Why not using an UPS?
http://www.pimodulescart.com/shop/item.aspx?itemid=30
guess for this there you'll find a driver in the libraray section to Access even via CODESYS the state of the UPS.
BR
Edwin


Top
   
PostPosted: Mon Nov 20, 2017 8:58 am 
Offline
User avatar

Joined: Thu Jan 21, 2016 10:58 am
Posts: 32
Hello Edwin,

I see now. Thanks for your reply!

BR,
Gergö


Top
   
PostPosted: Wed Jan 03, 2018 6:43 pm 
Offline
User avatar

Joined: Thu Jan 21, 2016 10:58 am
Posts: 32
Hello Edwin,

finally I got this:
http://www.raspberrypiwiki.com/index.php/Power_Pack_Pro

Amazon says it's an UPS HAT:
https://www.amazon.de/ILS-Geekworm-Expa ... B0769HHT95

However not completely clear how to use it... shouldn't be any GPIO which changes state when there is no external power supply? Do you get it how to use it exactly?

Thank you,
Gergö


Top
   
PostPosted: Thu Jan 04, 2018 8:13 am 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 3015
Hi,
not sure,
the requirements are simple and are basically not handled in CODESYS -> Linux OS and by the UPS

- detect the the switch off of the power supply
- trigger a graceful shudown of Linux

this means then . the runtime saves the retain file on shudown of the plc runtime
on next startup of the plc runtime the retains will be restored from the retain file.

That is it. You see basically this has nothing to do with CODESYS more or less you need and an UPS which does a graceful shutdown of the Linux System.
Could not really see if this is done by this UPS.

BR
Edwin


Top
   
PostPosted: Sat Jan 06, 2018 7:04 am 
Offline

Joined: Wed Dec 27, 2017 4:53 am
Posts: 3
Edwin Schwellinger wrote:
Hi Zdenko,

attached an example to realize a manual save of the retain variables.
Take care cyclic writing on the SD Card could damage the filesystem especially if you switch off the system while writing to files. (graceful shutdown is needed on Linux side...)

BR
Edwin


Hi Edwin, where I can find the retain file ? (*.ret)
both in windows and the raspberry

regards,
Lala


Top
   
PostPosted: Sat Jan 06, 2018 7:45 am 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 3015
Hi,
beside the bootproject
runtime Directory
/PlcLogic/Application/

for the the Pi this:

/var/opt/codesys/PlcLogic/Application
Application.app
Application.crc
Application.ret


For Control Win:
c:\ProgramData\CODESYS\CODESYSControlWinV3x64\801BFF8C\PlcLogic\Application

BR
Edwin


Top
   
PostPosted: Fri Jan 12, 2018 12:30 am 
Offline
Frequent User
Frequent User

Joined: Sun Apr 15, 2007 1:18 am
Posts: 149
Hello,

Is it not possible to store data in a file into a USB Key instead of the SD card ?
J do this in an Eaton PLC and its work well.
But I don't know how to name the USB Key with a Raspberry. :oops:

BR.

Japib


Top
   
PostPosted: Tue Mar 20, 2018 4:11 pm 
Offline

Joined: Mon Nov 02, 2015 2:28 pm
Posts: 16
If I have an UPS and reboot my raspberry does variables declared as retain will keep values??


Top
   
PostPosted: Wed Mar 21, 2018 8:35 pm 
Offline

Joined: Tue Sep 12, 2017 9:37 am
Posts: 77
If you gracefull shutdown raspberry yes, have or not have UPS.

BR


Top
   
PostPosted: Tue Dec 04, 2018 8:33 pm 
Offline

Joined: Wed Jan 20, 2016 12:04 pm
Posts: 3
Dear Edwin,

I cant use with retain variables with RPI3B+. Earlier RPI an Debain versions worked well. Raspberry shutdown is correct. I attached a PLC log file, wich consist a two error lines: Retain restore from file failed: [Application], area=1, size=4096,type=0x0020
Retain restore from file failed: [Application], area=2, size=4096,type=0x0120
HW: Rasperry PI3B+, Raspbian Strech 4.14., Runtime 3.5.13.20 licensed, Codesys V3.5SP13Patch2
Help me please
Thx


You do not have the required permissions to view the files attached to this post.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 48 posts ]  Go to page Previous 1 2 3 4 Next

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited