<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to ST Condition " CASE... OF" is not working in CoDesys SP RTE</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/74a47c47d4/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/74a47c47d4/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/74a47c47d4/</id><updated>2020-02-27T19:02:04.601000Z</updated><subtitle>Recent posts to ST Condition " CASE... OF" is not working in CoDesys SP RTE</subtitle><entry><title>ST Condition " CASE... OF" is not working in CoDesys SP RTE</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/74a47c47d4/?limit=25#78ea" rel="alternate"/><published>2020-02-27T19:02:04.601000Z</published><updated>2020-02-27T19:02:04.601000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.comece666110ec827a9b91cda743a9e8d642c9ffdd5</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;It is because the simulation checks the seconds but if you say time then it is in milliseconds. and as the program takes a few milliseconds to run the time is not exactly same but a little different.&lt;br/&gt;
so the solution is good and will work.&lt;br/&gt;
same is btw for almost all analog signals you will have to check the bounds.&lt;/p&gt;
&lt;p&gt;for this state machine look at  w &lt;a class="" href="http://www.oscat.de" rel="nofollow"&gt;www.oscat.de&lt;/a&gt; w &lt;br/&gt;
or have a look in SFC here you can do exactly same, as this chart is designed for this type of statemachines.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>ST Condition " CASE... OF" is not working in CoDesys SP RTE</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/74a47c47d4/?limit=25#19d0" rel="alternate"/><published>2020-02-27T19:02:01.262000Z</published><updated>2020-02-27T19:02:01.262000Z</updated><author><name>eschwellinger</name><uri>https://forge.codesys.com/u/eschwellinger/</uri></author><id>https://forge.codesys.comf93490c15581e77683ba1626aa538b47975ed67f</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello,&lt;br/&gt;
change the if case to &amp;gt;=...&lt;br/&gt;
IF inputtime&amp;gt;=t#5s THEN&lt;br/&gt;
then it works&lt;br/&gt;
cu&lt;br/&gt;
Edwin&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>ST Condition " CASE... OF" is not working in CoDesys SP RTE</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/74a47c47d4/?limit=25#3e70" rel="alternate"/><published>2020-02-27T19:02:00.086000Z</published><updated>2020-02-27T19:02:00.086000Z</updated><author><name>asifdip</name><uri>https://forge.codesys.com/u/asifdip/</uri></author><id>https://forge.codesys.comb01512de34cd6a20599270209457bf9d04cbe892</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi Everybody,&lt;br/&gt;
Hi,&lt;br/&gt;
I have noticed a very interesting problem in CodeSys 2.3. Actaully I am using CodeSys SP RTE target PCAN PCI. Everything is ok. As I can get all "StatusWORD" signal from my Canopen Node. But problem is like that:&lt;/p&gt;
&lt;p&gt;If I have written a very simple program in ST for "CASE... OF" condition , It works only in Simulation mode but when I load it in RTE SP PLC then it build &amp;amp; runs but it does not change the "CASE..OF" State. Case state has no change, it goes only in State 0: as it is first commnad but not State 1 or further. But in simulation , it works fine in all State.&lt;/p&gt;
&lt;p&gt;calltimer;&lt;br/&gt;
inputtime:=calltimer.timeroutput;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #4040FF;"&gt;CASE state OF&lt;br/&gt;
0:   output:=4;&lt;br/&gt;
      IF inputtime=t#5s THEN state:=State+1;   END_IF;&lt;br/&gt;
1:   output:=5;&lt;br/&gt;
      IF inputtime=t#10s THEN state:=State+1;END_IF;&lt;br/&gt;
2:   output:=90;&lt;br/&gt;
      IF inputtime=t#15s THEN state:=3;END_IF;&lt;br/&gt;
3:   output:=80;&lt;br/&gt;
       IF inputtime=t#20s THEN state:=state+1;END_IF;&lt;br/&gt;
4:   output:=12;&lt;br/&gt;
      IF inputtime=t#25sTHEN state:=0;END_IF;&lt;br/&gt;
END_CASE;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;But this program is ok in Simulation Mode It change the State from 0 to1, 1 to 2, 2 to 3. 3 to 4.&lt;br/&gt;
But when I load this program in CoDesys SP RTE, then It runs but No chage of "state". That means "CASE... of " operation is not working.&lt;br/&gt;
 I have need suggestion because i have to use this "Case..OF" state ment for CANopen State Machine to take in  opeartion.&lt;/p&gt;
&lt;p&gt;Thanks &lt;br/&gt;
Asif&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>