CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum
Deutsche Version English version russian version 
It is currently Tue Aug 22, 2017 9:24 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Wed Apr 19, 2017 9:34 am 
Offline

Joined: Wed Aug 12, 2015 12:16 pm
Posts: 12
For our controllers with more functionality (more time to compile and generate code) i have sporadic problems with the login function, which returns sometimes with an exception. It seems that there is a timing problem within the function:

Good case:
Skript Meldungen: Information: codesysServerScript.py(464 in download_and_run@443): online_application.login(OnlineChangeOption.Never, True)
Übersetzen: Text: C0: ------ Build started: Application: DeviceUnderTest.Application -------
Übersetzen: Text: C0: The application is up to date
Übersetzen: Text: C0: Kompilierung abgeschlossen -- 0 Fehler, 0 Warnungen
Übersetzen: Text: C0: ------ Build started: Application: DeviceUnderTest.Application -------
Übersetzen: Text: C0: The application is up to date
Übersetzen: Text: C0: generate code...
Übersetzen: Text: C0: generate global initializations ...
Übersetzen: Text: C0: generate code initialization ...
Übersetzen: Text: C0: generate relocations ...
Übersetzen: Information: C0: Size of generated code: 77820 bytes
Übersetzen: Information: C0: Size of global data: 16318 bytes
Übersetzen: Information: C0: Total allocated memory size for code and data: 120272 bytes
Übersetzen: Information: C0: Memory area 0 contains Data, Input, Output, Memory and Nonsafe Data: size: 131072 bytes, highest used address: 42432, largest contiguous memory gap: 88640 bytes (67 %)
Übersetzen: Information: C0: Memory area 1 contains Code: size: 131072 bytes, highest used address: 77840, largest contiguous memory gap: 53232 bytes (40 %)
Übersetzen: Text: C0: Build complete -- 0 errors, 0 warnings : ready for download!

Bad case:
Skript Meldungen: Information: codesysServerScript.py(464 in download_and_run@443): online_application.login(OnlineChangeOption.Never, True)
Übersetzen: Text: C0: ------ Build started: Application: DeviceUnderTest.Application -------
Übersetzen: Text: C0: typify code ...
Übersetzen: Text: C0: Kompilierung abgeschlossen -- 0 Fehler, 0 Warnungen
Skript Meldungen: Information: codesysServerScript.py(464 in download_and_run@443): Ausnahmefehler (<type 'exceptions.Exception'>, Exception('Einloggen fehlgeschlagen...',), <traceback object at 0x000000000000008E>)

For workaround i run the function 3 or 4 times in a row.

It never happend with the GUI.


Top
   
PostPosted: Wed Apr 19, 2017 10:57 am 
Offline
Frequent User
Frequent User

Joined: Tue Nov 13, 2012 9:20 am
Posts: 203
Hi PLKM.

PLKM wrote:
For our controllers with more functionality (more time to compile and generate code) i have sporadic problems with the login function, which returns sometimes with an exception. It seems that there is a timing problem within the function:

Bad case:
Skript Meldungen: Information: codesysServerScript.py(464 in download_and_run@443): online_application.login(OnlineChangeOption.Never, True)
Übersetzen: Text: C0: ------ Build started: Application: DeviceUnderTest.Application -------
Übersetzen: Text: C0: typify code ...
Übersetzen: Text: C0: Kompilierung abgeschlossen -- 0 Fehler, 0 Warnungen
Skript Meldungen: Information: codesysServerScript.py(464 in download_and_run@443): Ausnahmefehler (<type 'exceptions.Exception'>, Exception('Einloggen fehlgeschlagen...',), <traceback object at 0x000000000000008E>)

For workaround i run the function 3 or 4 times in a row.

It never happend with the GUI.

Which version of CODESYS do you use? Is the project just loaded before the login?

Instead of repeating the login you can try to add a delay with system.delay(x) before the login. For the start I would use 5000ms and reduce it step by step if it works.

BR
Martin

_________________
Check out the CODESYS store: http://store.codesys.com/

CODESYS® a trademark of 3S-Smart Software Solutions GmbH
Inspiring Automation Solutions


Top
   
PostPosted: Thu Apr 20, 2017 1:05 pm 
Offline

Joined: Wed Aug 12, 2015 12:16 pm
Posts: 12
I use SP10 Patch 1 and there is no interaction with CODESYS at least 15 seconds before the login method.

I already tried it with System.Delay(x) before the login, but the failure still exists.

If i pregenerate the code with the generate_code() method it seems to be better, but the failure is still available sporadically.


Top
   
PostPosted: Fri Apr 21, 2017 11:06 am 
Offline
Frequent User
Frequent User

Joined: Tue Nov 13, 2012 9:20 am
Posts: 203
Hi PLKM.

PLKM wrote:
I already tried it with System.Delay(x) before the login, but the failure still exists.

If i pregenerate the code with the generate_code() method it seems to be better, but the failure is still available sporadically.

You can try to use RaiseIdle() in combination with system.delay(). There are a few things in CODESYS which are executed with the Idle event. Call RaiseIdle(EventArgs.Empty) and system.delay(500) a few times before the login.

If that does not help we could have a problem in the noUI mode which we need to investigate.

Code:
import clr
clr.AddReference("System.Windows.Forms")
from System.Windows.Forms import Application
from System import EventArgs

Application.RaiseIdle(EventArgs.Empty)

What is your Use Case for using the noUI mode?

BR
Martin

_________________
Check out the CODESYS store: http://store.codesys.com/

CODESYS® a trademark of 3S-Smart Software Solutions GmbH
Inspiring Automation Solutions


Top
   
PostPosted: Wed May 03, 2017 10:21 am 
Offline

Joined: Wed Aug 12, 2015 12:16 pm
Posts: 12
M.Keller wrote:
Hi PLKM.

PLKM wrote:
I already tried it with System.Delay(x) before the login, but the failure still exists.

If i pregenerate the code with the generate_code() method it seems to be better, but the failure is still available sporadically.

You can try to use RaiseIdle() in combination with system.delay(). There are a few things in CODESYS which are executed with the Idle event. Call RaiseIdle(EventArgs.Empty) and system.delay(500) a few times before the login.

If that does not help we could have a problem in the noUI mode which we need to investigate.

Code:
import clr
clr.AddReference("System.Windows.Forms")
from System.Windows.Forms import Application
from System import EventArgs

Application.RaiseIdle(EventArgs.Empty)

What is your Use Case for using the noUI mode?

BR
Martin


The RaiseIdle Method seems to help. I will do some more tests in the next days.

The noUI mode is for automated tests for our controllers, which are running in the background.


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

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 1 guest


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