<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Sporadic problems at login via script</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/aad3d2fafe/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/aad3d2fafe/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/aad3d2fafe/</id><updated>2020-02-27T15:02:41.608000Z</updated><subtitle>Recent posts to Sporadic problems at login via script</subtitle><entry><title>Sporadic problems at login via script</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/aad3d2fafe/?limit=25#bbfa" rel="alternate"/><published>2020-02-27T15:02:41.608000Z</published><updated>2020-02-27T15:02:41.608000Z</updated><author><name>PLKM</name><uri>https://forge.codesys.com/u/plkm/</uri></author><id>https://forge.codesys.come02cbafb5f769571618b28aab145ef2e43914103</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;M.Keller hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
Hi PLKM.&lt;br/&gt;
You can try to use  in combination with . There are a few things in CODESYS which are executed with the Idle event. Call  and  a few times before the login.&lt;br/&gt;
If that does not help we could have a problem in the noUI mode which we need to investigate.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;clr&lt;/span&gt;
&lt;span class="n"&gt;clr&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;AddReference&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"System.Windows.Forms"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;System.Windows.Forms&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Application&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;System&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;EventArgs&lt;/span&gt;
&lt;span class="n"&gt;Application&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;RaiseIdle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;EventArgs&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Empty&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;What is your Use Case for using the noUI mode?&lt;br/&gt;
BR&lt;br/&gt;
Martin&lt;/p&gt;
&lt;p&gt;The RaiseIdle Method seems to help. I will do some more tests in the next days.&lt;/p&gt;
&lt;p&gt;The noUI mode is for automated tests for our controllers, which are running in the background.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Sporadic problems at login via script</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/aad3d2fafe/?limit=25#7c65" rel="alternate"/><published>2020-02-27T15:02:40.980000Z</published><updated>2020-02-27T15:02:40.980000Z</updated><author><name>mkeller</name><uri>https://forge.codesys.com/u/mkeller/</uri></author><id>https://forge.codesys.com7121cbf8c639e64cf50bfa0a98441824211409d9</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi PLKM.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;PLKM hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
I already tried it with System.Delay(x) before the login, but the failure still exists.&lt;br/&gt;
If i pregenerate the code with the generate_code() method it seems to be better, but the failure is still available sporadically.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;You can try to use  in combination with . There are a few things in CODESYS which are executed with the Idle event. Call  and  a few times before the login.&lt;/p&gt;
&lt;p&gt;If that does not help we could have a problem in the noUI mode which we need to investigate.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;clr&lt;/span&gt;
&lt;span class="n"&gt;clr&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;AddReference&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"System.Windows.Forms"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;System.Windows.Forms&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Application&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;System&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;EventArgs&lt;/span&gt;
&lt;span class="n"&gt;Application&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;RaiseIdle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;EventArgs&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Empty&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;What is your Use Case for using the noUI mode?&lt;/p&gt;
&lt;p&gt;BR&lt;br/&gt;
Martin&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Sporadic problems at login via script</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/aad3d2fafe/?limit=25#2b71" rel="alternate"/><published>2020-02-27T15:02:40.362000Z</published><updated>2020-02-27T15:02:40.362000Z</updated><author><name>PLKM</name><uri>https://forge.codesys.com/u/plkm/</uri></author><id>https://forge.codesys.coma6ce37b4308ba54b6de87444467148c78c571867</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I use SP10 Patch 1 and there is no interaction with CODESYS at least 15 seconds before the login method.&lt;/p&gt;
&lt;p&gt;I already tried it with System.Delay(x) before the login, but the failure still exists.&lt;/p&gt;
&lt;p&gt;If i pregenerate the code with the generate_code() method it seems to be better, but the failure is still available sporadically.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Sporadic problems at login via script</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/aad3d2fafe/?limit=25#ca18" rel="alternate"/><published>2020-02-27T15:02:38.592000Z</published><updated>2020-02-27T15:02:38.592000Z</updated><author><name>mkeller</name><uri>https://forge.codesys.com/u/mkeller/</uri></author><id>https://forge.codesys.com190fbd2b46697f66773a73d3cc7925f6b7626228</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi PLKM.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;PLKM hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
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:&lt;br/&gt;
Bad case:&lt;br/&gt;
Skript Meldungen: Information: codesysServerScript.py(464 in download_and_run@443):                 online_application.login(OnlineChangeOption.Never, True)&lt;br/&gt;
Übersetzen: Text: C0: ------ Build started: Application: DeviceUnderTest.Application -------&lt;br/&gt;
Übersetzen: Text: C0: typify code ...&lt;br/&gt;
Übersetzen: Text: C0: Kompilierung abgeschlossen -- 0 Fehler, 0 Warnungen&lt;br/&gt;
Skript Meldungen: Information: codesysServerScript.py(464 in download_and_run@443): Ausnahmefehler (&amp;lt;type 'exceptions.exception'=""&amp;gt;, Exception('Einloggen fehlgeschlagen...',), &amp;lt;traceback object="" at="" 0x000000000000008e=""&amp;gt;)&lt;br/&gt;
For workaround i run the function 3 or 4 times in a row.&lt;br/&gt;
It never happend with the GUI.&amp;lt;/traceback&amp;gt;&amp;lt;/type&amp;gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Which version of CODESYS do you use? Is the project just loaded before the login?&lt;/p&gt;
&lt;p&gt;Instead of repeating the login you can try to add a delay with  before the login. For the start I would use 5000ms and reduce it step by step if it works.&lt;/p&gt;
&lt;p&gt;BR&lt;br/&gt;
Martin&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Sporadic problems at login via script</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/aad3d2fafe/?limit=25#4153" rel="alternate"/><published>2020-02-27T15:02:37.934000Z</published><updated>2020-02-27T15:02:37.934000Z</updated><author><name>PLKM</name><uri>https://forge.codesys.com/u/plkm/</uri></author><id>https://forge.codesys.com506d9db8ff752f059f154e138376db7ee1bedf4f</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;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:&lt;/p&gt;
&lt;p&gt;Good case:&lt;br/&gt;
Skript Meldungen: Information: codesysServerScript.py(464 in download_and_run@443):                 online_application.login(OnlineChangeOption.Never, True)&lt;br/&gt;
Übersetzen: Text: C0: ------ Build started: Application: DeviceUnderTest.Application -------&lt;br/&gt;
Übersetzen: Text: C0: The application is up to date&lt;br/&gt;
Übersetzen: Text: C0: Kompilierung abgeschlossen -- 0 Fehler, 0 Warnungen&lt;br/&gt;
Übersetzen: Text: C0: ------ Build started: Application: DeviceUnderTest.Application -------&lt;br/&gt;
Übersetzen: Text: C0: The application is up to date&lt;br/&gt;
Übersetzen: Text: C0: generate code...&lt;br/&gt;
Übersetzen: Text: C0: generate global initializations ...&lt;br/&gt;
Übersetzen: Text: C0: generate code initialization ...&lt;br/&gt;
Übersetzen: Text: C0: generate relocations ...&lt;br/&gt;
Übersetzen: Information: C0: Size of generated code: 77820 bytes&lt;br/&gt;
Übersetzen: Information: C0: Size of global data: 16318 bytes&lt;br/&gt;
Übersetzen: Information: C0: Total allocated memory size for code and data: 120272 bytes&lt;br/&gt;
Ü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 %)&lt;br/&gt;
Übersetzen: Information: C0: Memory area 1 contains  Code: size: 131072 bytes, highest used address: 77840, largest contiguous memory gap: 53232 bytes (40 %)&lt;br/&gt;
Übersetzen: Text: C0: Build complete -- 0 errors, 0 warnings : ready for download!&lt;/p&gt;
&lt;p&gt;Bad case:&lt;br/&gt;
Skript Meldungen: Information: codesysServerScript.py(464 in download_and_run@443):                 online_application.login(OnlineChangeOption.Never, True)&lt;br/&gt;
Übersetzen: Text: C0: ------ Build started: Application: DeviceUnderTest.Application -------&lt;br/&gt;
Übersetzen: Text: C0: typify code ...&lt;br/&gt;
Übersetzen: Text: C0: Kompilierung abgeschlossen -- 0 Fehler, 0 Warnungen&lt;br/&gt;
Skript Meldungen: Information: codesysServerScript.py(464 in download_and_run@443): Ausnahmefehler (&amp;lt;type 'exceptions.exception'=""&amp;gt;, Exception('Einloggen fehlgeschlagen...',), &amp;lt;traceback object="" at="" 0x000000000000008e=""&amp;gt;)&amp;lt;/traceback&amp;gt;&amp;lt;/type&amp;gt;&lt;/p&gt;
&lt;p&gt;For workaround i run the function 3 or 4 times in a row.&lt;/p&gt;
&lt;p&gt;It never happend with the GUI.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>