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 Sun Dec 08, 2019 3:35 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Sun Nov 24, 2019 10:06 am 
Offline

Joined: Tue Nov 05, 2019 8:02 am
Posts: 5
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 viewtopic.php?f=21&t=5722&start=30#p20093, 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 wrote:
Hi,
beside the bootproject
runtime Directory
/PlcLogic/Application/

for the the Pi this:

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


Top
   
PostPosted: Mon Nov 25, 2019 8:10 pm 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 3562
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


Top
   
PostPosted: Mon Nov 25, 2019 10:38 pm 
Offline

Joined: Tue Nov 05, 2019 8:02 am
Posts: 5
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:

Code:
2019-11-25T21:24:48Z, 0x00000002, 2, 1288, 49, !!!! Warning: Retain data are initialized now of [<app>HomeAutomation</app>]
2019-11-25T21:24:48Z, 0x00000002, 1, 0, 2, Application [<app>HomeAutomation</app>] loaded via [Bootproject]
2019-11-25T21:24:48Z, 0x00000126, 1, 0, 0, Valid license found for OPC UA IecVarAccess provider.
2019-11-25T21:24:48Z, 0x00000002, 1, 0, 7, Retains matched to bootproject of application [<app>HomeAutomation</app>]
2019-11-25T21:24:48Z, 0x00000002, 1, 0, 6, Bootproject of application [<app>HomeAutomation</app>] loaded
2019-11-25T21:24:48Z, 0x00000018, 1, 0, 1, Setting router <instance>0</instance> address to <address>(006b)</address>
2019-11-25T21:24:48Z, 0x00000018, 1, 0, 1, Setting router <instance>1</instance> address to <address>(2ddc:c0a8:156b)</address>
2019-11-25T21:24:48Z, 0x00000002, 1, 0, 10, Application [<app>HomeAutomation</app>] started
2019-11-25T21:24:48Z, 0x00000001, 1, 0, 34, CODESYS Control ready
2019-11-25T21:27:00Z, 0x00000001, 2, 0, 0, !!!! Warning: no runtime license - running in demo mode(~119 minutes)


Thanks


Top
   
PostPosted: Tue Nov 26, 2019 8:40 pm 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 3562
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


Top
   
PostPosted: Wed Nov 27, 2019 5:31 am 
Offline

Joined: Tue Nov 05, 2019 8:02 am
Posts: 5
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.
Code:
pi@CodesysPi:~ $ sudo service codesyscontrol start
pi@CodesysPi:~ $ tail -f /tmp/codesyscontrol.log
2019-11-27T04:18:56Z, 0x00000002, 2, 1288, 49, !!!! Warning: Retain data are initialized now of [<app>HomeAutomation</app>]
2019-11-27T04:18:56Z, 0x00000002, 1, 0, 2, Application [<app>HomeAutomation</app>] loaded via [Bootproject]
2019-11-27T04:18:56Z, 0x00000126, 1, 0, 0, Valid license found for OPC UA IecVarAccess provider.
2019-11-27T04:18:56Z, 0x00000002, 1, 0, 7, Retains matched to bootproject of application [<app>HomeAutomation</app>]
2019-11-27T04:18:56Z, 0x00000002, 1, 0, 6, Bootproject of application [<app>HomeAutomation</app>] loaded
2019-11-27T04:18:56Z, 0x00000018, 1, 0, 1, Setting router <instance>0</instance> address to <address>(006b)</address>
2019-11-27T04:18:56Z, 0x00000018, 1, 0, 1, Setting router <instance>1</instance> address to <address>(2ddc:c0a8:156b)</address>
2019-11-27T04:18:56Z, 0x00000002, 1, 0, 10, Application [<app>HomeAutomation</app>] started
2019-11-27T04:18:56Z, 0x00000001, 1, 0, 34, CODESYS Control ready
2019-11-27T04:19:58Z, 0x00000001, 2, 0, 0, !!!! Warning: no runtime license - running in demo mode(~119 minutes)
^C
pi@CodesysPi:~ $ sudo service codesyscontrol stop
pi@CodesysP
pi@CodesysPi:~ $ tail -f /tmp/codesyscontrol.log
2019-11-27T04:18:56Z, 0x00000002, 2, 1288, 49, !!!! Warning: Retain data are initialized now of [<app>HomeAutomation</app>]
2019-11-27T04:18:56Z, 0x00000002, 1, 0, 2, Application [<app>HomeAutomation</app>] loaded via [Bootproject]
2019-11-27T04:18:56Z, 0x00000126, 1, 0, 0, Valid license found for OPC UA IecVarAccess provider.
2019-11-27T04:18:56Z, 0x00000002, 1, 0, 7, Retains matched to bootproject of application [<app>HomeAutomation</app>]
2019-11-27T04:18:56Z, 0x00000002, 1, 0, 6, Bootproject of application [<app>HomeAutomation</app>] loaded
2019-11-27T04:18:56Z, 0x00000018, 1, 0, 1, Setting router <instance>0</instance> address to <address>(006b)</address>
2019-11-27T04:18:56Z, 0x00000018, 1, 0, 1, Setting router <instance>1</instance> address to <address>(2ddc:c0a8:156b)</address>
2019-11-27T04:18:56Z, 0x00000002, 1, 0, 10, Application [<app>HomeAutomation</app>] started
2019-11-27T04:18:56Z, 0x00000001, 1, 0, 34, CODESYS Control ready
2019-11-27T04:19:58Z, 0x00000001, 2, 0, 0, !!!! Warning: no runtime license - running in demo mode(~119 minutes)


Only an error regarding retain restore when rebooting the pi:
Code:
pi@CodesysPi:~ $ sudo reboot now

pi@CodesysPi:~ $ tail -f /tmp/codesyscontrol.log
2019-11-27T04:23:31Z, 0x00000002, 4, 16, 40, **** ERROR: Retain restore from file failed: [<app>HomeAutomation</app>], area=<area>2</area>, size=<size>4096</size>, type=<type>0x0120</t
2019-11-27T04:23:31Z, 0x00000002, 2, 1288, 49, !!!! Warning: Retain data are initialized now of [<app>HomeAutomation</app>]
2019-11-27T04:23:32Z, 0x00000002, 1, 0, 2, Application [<app>HomeAutomation</app>] loaded via [Bootproject]
2019-11-27T04:23:32Z, 0x00000126, 1, 0, 0, Valid license found for OPC UA IecVarAccess provider.
2019-11-27T04:23:32Z, 0x00000002, 1, 0, 7, Retains matched to bootproject of application [<app>HomeAutomation</app>]
2019-11-27T04:23:32Z, 0x00000002, 1, 0, 6, Bootproject of application [<app>HomeAutomation</app>] loaded
2019-11-27T04:23:32Z, 0x00000018, 1, 0, 1, Setting router <instance>0</instance> address to <address>(006b)</address>
2019-11-27T04:23:32Z, 0x00000018, 1, 0, 1, Setting router <instance>1</instance> address to <address>(2ddc:c0a8:156b)</address>
2019-11-27T04:23:32Z, 0x00000002, 1, 0, 10, Application [<app>HomeAutomation</app>] started
2019-11-27T04:23:32Z, 0x00000001, 1, 0, 34, CODESYS Control ready

Here is a link to an archive of the project in case that helps:
https://1drv.ms/u/s!AuoLjdHk1C3_hJxObMynRYwrdtMxgA?e=fBXAuI


Top
   
PostPosted: Wed Nov 27, 2019 9:04 am 
Offline

Joined: Tue Nov 05, 2019 8:02 am
Posts: 5
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 ...


Top
   
PostPosted: Tue Dec 03, 2019 7:15 am 
Offline

Joined: Tue Nov 05, 2019 8:02 am
Posts: 5
Hi Edwin - do you have any idea why this isn't working or any further steps I can take to troubleshoot it?


Top
   
PostPosted: Tue Dec 03, 2019 8:26 am 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 3562
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


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 8 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 5 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