<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Using Output variables of a function block</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/54cab3d5ae/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/54cab3d5ae/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/54cab3d5ae/</id><updated>2020-02-27T22:25:55.633000Z</updated><subtitle>Recent posts to Using Output variables of a function block</subtitle><entry><title>Using Output variables of a function block</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/54cab3d5ae/?limit=25#7ac2" rel="alternate"/><published>2020-02-27T22:25:55.633000Z</published><updated>2020-02-27T22:25:55.633000Z</updated><author><name>ljean</name><uri>https://forge.codesys.com/u/ljean/</uri></author><id>https://forge.codesys.com7725838ef1df4629089e4882cdf7eb4d4d25d1f1</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;This problem has been fixed with CoDeSys 2.3.9.0&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Using Output variables of a function block</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/54cab3d5ae/?limit=25#dee9" rel="alternate"/><published>2020-02-27T22:25:54.071000Z</published><updated>2020-02-27T22:25:54.071000Z</updated><author><name>Ralph Holz</name><uri>https://forge.codesys.com/u/ralph-holz/</uri></author><id>https://forge.codesys.comf775975e7e9200f62f8453a160db78e71cda1824</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Both codes look correct and should be possible. Did you check your project by changing the Target to another type of PLC PLCWinNT for example?&lt;/p&gt;
&lt;p&gt;Regards Ralph&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Using Output variables of a function block</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/54cab3d5ae/?limit=25#4282" rel="alternate"/><published>2020-02-27T22:25:49.712000Z</published><updated>2020-02-27T22:25:49.712000Z</updated><author><name>ljean</name><uri>https://forge.codesys.com/u/ljean/</uri></author><id>https://forge.codesys.com2b1abeb14e8b6ad278e170d7b8310580f486f063</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Here are 2 different ways to access the output variable of a FB. It looks similar but it seems that the 2nd one cause crash.&lt;/p&gt;
&lt;p&gt;I had the problem with REAL variables. It is Ok with the 1st method.&lt;/p&gt;
&lt;p&gt;I am using the Coldfire compiler.&lt;/p&gt;
&lt;p&gt;Is the 2nd way correct? &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nv"&gt;MyFunctionBlock&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;VarInput1&lt;/span&gt;:&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;aa&lt;/span&gt;&lt;span class="s1"&gt;'&lt;/span&gt;, &lt;span class="nv"&gt;VarInput2&lt;/span&gt;:&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;22&lt;/span&gt;, &lt;span class="nv"&gt;VarOutput1&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="nv"&gt;LocalVar1&lt;/span&gt;, &lt;span class="nv"&gt;VarOutput2&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="nv"&gt;LocalVar2&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="nv"&gt;LocalVar1&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt;
  &lt;span class="nv"&gt;x&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;LocalVar2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
  ...
&lt;span class="nv"&gt;END_IF&lt;/span&gt;
...
&lt;/pre&gt;&lt;/div&gt;


&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nv"&gt;MyFunctionBlock&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;VarInput1&lt;/span&gt;:&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;aa&lt;/span&gt;&lt;span class="s1"&gt;'&lt;/span&gt;, &lt;span class="nv"&gt;VarInput2&lt;/span&gt;:&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;22&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="nv"&gt;MyFunctionBlock&lt;/span&gt;.&lt;span class="nv"&gt;VarOutput1&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt;
  &lt;span class="nv"&gt;x&lt;/span&gt; :&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;MyFunctionBlock&lt;/span&gt;.&lt;span class="nv"&gt;VarOutput2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="c1"&gt;;&lt;/span&gt;
  ...
&lt;span class="nv"&gt;END_IF&lt;/span&gt;
...
&lt;/pre&gt;&lt;/div&gt;

&lt;/div&gt;</summary></entry></feed>