<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Doubt with these ST coding...</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/5e06bacc78/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/5e06bacc78/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/5e06bacc78/</id><updated>2020-02-27T20:03:02.531000Z</updated><subtitle>Recent posts to Doubt with these ST coding...</subtitle><entry><title>Doubt with these ST coding...</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/5e06bacc78/?limit=25#f627" rel="alternate"/><published>2020-02-27T20:03:02.531000Z</published><updated>2020-02-27T20:03:02.531000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.com31c46913a823ef76a32a5f51680cc4cff608a6d3</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;and please do not exit inside a loop as the stack will not be correct.&lt;/p&gt;
&lt;p&gt;do the question before the loop or after it.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Doubt with these ST coding...</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/5e06bacc78/?limit=25#83f6" rel="alternate"/><published>2020-02-27T20:03:01.219000Z</published><updated>2020-02-27T20:03:01.219000Z</updated><author><name>Igor Petrov</name><uri>https://forge.codesys.com/u/igor-petrov/</uri></author><id>https://forge.codesys.combe8b8eac58d09de6f4e7346d9497831bf0cb552c</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;You did 'Single cycle' in the debugger, therefore you saw only the final results – after the last iteration. &lt;/p&gt;
&lt;p&gt;In details:&lt;/p&gt;
&lt;p&gt;Inside 1-st iteration   m1 = m3 =  0 – EXIT&lt;/p&gt;
&lt;p&gt;…&lt;/p&gt;
&lt;p&gt;Inside 6-st iteration m1=5,  m3 = 0 – m3 runs from 0 to 5&lt;/p&gt;
&lt;p&gt;Do try to use a breakpoint and you will catch it.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Doubt with these ST coding...</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/5e06bacc78/?limit=25#97b8" rel="alternate"/><published>2020-02-27T20:02:57.522000Z</published><updated>2020-02-27T20:02:57.522000Z</updated><author><name>hcchin</name><uri>https://forge.codesys.com/u/hcchin/</uri></author><id>https://forge.codesys.com6961d44a76284c31b82a36acdcc34d27e5cbb067</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Both Example has the 'Exit' operator, but it work differently... why...???&lt;/p&gt;
&lt;p&gt;I feel a bit strange at the 'Exit' operator in the Example 2..&lt;/p&gt;
&lt;p&gt;My understanding, In the example 1 and 2, the m3 For loop shouldn't be working with their condition because of the 'Exit' operator will end the innermost loop but the Example 2 works why?&lt;/p&gt;
&lt;p&gt;Anyone could help to explain...???&lt;/p&gt;
&lt;p&gt;For the Example 1, &lt;/p&gt;
&lt;p&gt;The IF condition's M200 always True and as a result&lt;/p&gt;
&lt;p&gt;M3 got 0 value.(it didn't loop at all).&lt;/p&gt;
&lt;p&gt;For The Example 2,&lt;/p&gt;
&lt;p&gt;The IF condition's when M1=M3 and as a result &lt;/p&gt;
&lt;p&gt;M3 got 5.&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: For loop with Exit Operator_Q2.JPG" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=171"/&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: For loop with Exit Operator_Q1.JPG" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=170"/&gt;&lt;/p&gt;
&lt;p&gt;&lt;a class="" href="https://forum.codesys.com//download/file.php?id=169" rel="nofollow"&gt;for_test_with_exit2_ok.pro &lt;span&gt;&lt;span&gt;[23.66 KiB]&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>