<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Timeout Unit Test</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/414adfc714/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/414adfc714/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/414adfc714/</id><updated>2020-02-27T15:08:42.837000Z</updated><subtitle>Recent posts to Timeout Unit Test</subtitle><entry><title>Timeout Unit Test</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/414adfc714/?limit=25#76dc" rel="alternate"/><published>2020-02-27T15:08:42.837000Z</published><updated>2020-02-27T15:08:42.837000Z</updated><author><name>Malcolm</name><uri>https://forge.codesys.com/u/malcolm/</uri></author><id>https://forge.codesys.comcc08af418ba36a8f8d9055dc228c263297593cad</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi Martin,&lt;/p&gt;
&lt;p&gt;thank you for your solution. That's exactly what I was looking for. Now it works perfect.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br/&gt;
Malcolm&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Timeout Unit Test</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/414adfc714/?limit=25#100c" rel="alternate"/><published>2020-02-27T15:08:41.045000Z</published><updated>2020-02-27T15:08:41.045000Z</updated><author><name>mkeller</name><uri>https://forge.codesys.com/u/mkeller/</uri></author><id>https://forge.codesys.comd451ded52eb567befa42b8d706e19721b30d46bc</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi Malcolm.&lt;/p&gt;
&lt;p&gt;Okay, that makes sense.&lt;/p&gt;
&lt;p&gt;I think your problem could be the default timeout of 15 seconds for a test case. You need to specifiy a bigger timeout by adding the following attribute to the declaration of the test POU:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="err"&gt;{&lt;/span&gt;&lt;span class="n"&gt;attribute&lt;/span&gt; &lt;span class="s1"&gt;'testcasetimeout'&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'3600000'&lt;/span&gt;&lt;span class="err"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;The specified string for the timeout must be convertable to an 32-bit signed integer. For example '3600000' for an 1 hour (= 3600000 ms) timeout.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br/&gt;
Martin&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Timeout Unit Test</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/414adfc714/?limit=25#de57" rel="alternate"/><published>2020-02-27T15:08:40.413000Z</published><updated>2020-02-27T15:08:40.413000Z</updated><author><name>Malcolm</name><uri>https://forge.codesys.com/u/malcolm/</uri></author><id>https://forge.codesys.comf93da6f4cc3a79f0105873b1d678666e310ff495</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;M.Schaber hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
First, there is no IF-loop. An if-construct is not a loop, as it does not have any repetitions, it only provides conditional execution.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Sorry für the confusion. I have an if-construct with an inner if-construct which resets  in a specific condition nCycle.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Timeout Unit Test</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/414adfc714/?limit=25#5217" rel="alternate"/><published>2020-02-27T15:08:39.763000Z</published><updated>2020-02-27T15:08:39.763000Z</updated><author><name>Anonymous</name><uri>https://forge.codesys.com/u/*anonymous/</uri></author><id>https://forge.codesys.com6da10b13e3cf4a7d279ce4d18259750a763d88ee</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;em&gt;Originally created by:&lt;/em&gt; M.Schaber&lt;/p&gt;
&lt;p&gt;Hi, Malcolm,&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Malcolm hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
when I perform a Unit Test with an IF-loop with multiple runs (&amp;gt; 1000, used in the method prvCyclicAction) my test breaks off after about 40s due to timeout. &lt;br/&gt;
How can I prevent it with the same number of passes?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I have to admit I'm a little bit confused by your question.&lt;/p&gt;
&lt;p&gt;First, there is no IF-loop. An if-construct is not a loop, as it does not have any repetitions, it only provides conditional execution.&lt;/p&gt;
&lt;p&gt;Second, you should not use long-running loops in code which runs in the IEC task cycle. You will exceed the tasks cycle time, and block all other operations (like other tasks, refreshing of inputs and outputs, and communication with CODESYS).&lt;/p&gt;
&lt;p&gt;You need to "inverse" the logic of thinking here: your code is already running in a loop (the task cycle), so within the prvCyclicAction method, just perform a single pass of your loop. This may look strange, but it is the IEC-61131 way of thinking.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Timeout Unit Test</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/414adfc714/?limit=25#2d6d" rel="alternate"/><published>2020-02-27T15:08:37.994000Z</published><updated>2020-02-27T15:08:37.994000Z</updated><author><name>Malcolm</name><uri>https://forge.codesys.com/u/malcolm/</uri></author><id>https://forge.codesys.com381a053c0ebf0fb1fe18ab51e33769397b1c4334</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;when I perform a Unit Test with an IF-loop with multiple runs (&amp;gt; 1000, used in the method prvCyclicAction) my test breaks off after about 40s due to timeout. &lt;/p&gt;
&lt;p&gt;How can I prevent it with the same number of passes?&lt;/p&gt;
&lt;p&gt;Regards, &lt;br/&gt;
Malcolm&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>