<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Error result in simple ST  'IF Else' result </title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/5c0265af58/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/5c0265af58/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/5c0265af58/</id><updated>2021-07-31T15:55:03.652000Z</updated><subtitle>Recent posts to Error result in simple ST  'IF Else' result </subtitle><entry><title>Error result in simple ST  'IF Else' result </title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/5c0265af58/?limit=25#0b10" rel="alternate"/><published>2021-07-31T15:55:03.652000Z</published><updated>2021-07-31T15:55:03.652000Z</updated><author><name>Fless</name><uri>https://forge.codesys.com/u/fless/</uri></author><id>https://forge.codesys.com7093df0975eee2f4f3a101ffb297a1b2d0f1b093</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;take a look in your Program Modbus&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="err"&gt;IF  GVL.AC_Running := TRUE THEN&lt;/span&gt;
&lt;span class="err"&gt;    AC_PWR_Use := GVL.AC_Watts;&lt;/span&gt;
&lt;span class="err"&gt;END_IF&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;you wanted to check GVL.AC_Running = TRUE but you set it to true.&lt;/p&gt;
&lt;p&gt;to avoid such mistakes simply use statements like&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="n"&gt;xRunning&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt;
    &lt;span class="p"&gt;...;&lt;/span&gt;
&lt;span class="n"&gt;END_IF&lt;/span&gt;

&lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="n"&gt;xRunning&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt;
    &lt;span class="p"&gt;...;&lt;/span&gt;
&lt;span class="n"&gt;END_IF&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;/div&gt;</summary></entry><entry><title>Error result in simple ST  'IF Else' result </title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/5c0265af58/?limit=25#2a7d" rel="alternate"/><published>2021-07-31T11:41:40.034000Z</published><updated>2021-07-31T11:41:40.034000Z</updated><author><name>i-campbell</name><uri>https://forge.codesys.com/u/i-campbell/</uri></author><id>https://forge.codesys.com745a59454ea7a85b6def8de61a568f9340805835</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;project please. and simulation mode or downloaded to plc? which ide version?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Error result in simple ST  'IF Else' result </title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/5c0265af58/?limit=25#8597" rel="alternate"/><published>2021-07-31T11:24:48.171000Z</published><updated>2021-07-31T11:24:48.171000Z</updated><author><name>bernie-bbq</name><uri>https://forge.codesys.com/u/bernie-bbq/</uri></author><id>https://forge.codesys.comea06f3a50e2ebd6fb63c07697800cea3d32ef141</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi, The result of a simple IF Else command &lt;strong&gt;is incorrect&lt;/strong&gt;. I know this seems impossible but seeing is believing. Image attached. The variables have been set correctly; one WORD 'GVL.AC_Watts' and one BOOL 'GVL.AC_Running'. Why is the BOOL showing 'TRUE' when clearly 71 &amp;gt; 100 is 'FALSE'&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>