<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Function in Codesys and the wrong return value</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b74a904171/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b74a904171/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/b74a904171/</id><updated>2021-03-17T12:58:18.172000Z</updated><subtitle>Recent posts to Function in Codesys and the wrong return value</subtitle><entry><title>Function in Codesys and the wrong return value</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b74a904171/?limit=25#a036" rel="alternate"/><published>2021-03-17T12:58:18.172000Z</published><updated>2021-03-17T12:58:18.172000Z</updated><author><name>alex</name><uri>https://forge.codesys.com/u/alex/</uri></author><id>https://forge.codesys.comde7d1055203ce8c8d32851970fdd84336bc7697d</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Miracle happens ojz0r, indeed it fixes stuff immediately and provides a warm and fuzzy feeling.&lt;br/&gt;
Thank you much guys for help,, Resolved.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Function in Codesys and the wrong return value</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b74a904171/?limit=25#7bb7" rel="alternate"/><published>2021-03-17T06:49:13.885000Z</published><updated>2021-03-17T06:49:13.885000Z</updated><author><name>ojz0r</name><uri>https://forge.codesys.com/u/ojz0r/</uri></author><id>https://forge.codesys.comcd08047e09373deabbd7e93ef1d37a65bef77974</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;What happens if you write:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="k"&gt;result&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;num01&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;num02&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Function in Codesys and the wrong return value</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b74a904171/?limit=25#574a/7f96" rel="alternate"/><published>2021-03-16T21:38:31.583000Z</published><updated>2021-03-16T21:38:31.583000Z</updated><author><name>alex</name><uri>https://forge.codesys.com/u/alex/</uri></author><id>https://forge.codesys.comfd2aae58ba95af04571c78e66c54b77cf382a404</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Yes Supplemental is one of the two tasks under MAST.&lt;br/&gt;
Like mentioned before code worked ok in Function Block but not in a function..&lt;img src="./attachment/attachment.png" width="50%"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Function in Codesys and the wrong return value</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b74a904171/?limit=25#574a" rel="alternate"/><published>2021-03-16T21:32:58.004000Z</published><updated>2021-03-16T21:32:58.004000Z</updated><author><name>i-campbell</name><uri>https://forge.codesys.com/u/i-campbell/</uri></author><id>https://forge.codesys.com508a1097932696e6190cb99c15fa9ac40fecea68</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Is Supplemental being called?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Function in Codesys and the wrong return value</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/b74a904171/?limit=25#ac4c" rel="alternate"/><published>2021-03-16T21:13:25.769000Z</published><updated>2021-03-16T21:13:25.769000Z</updated><author><name>alex</name><uri>https://forge.codesys.com/u/alex/</uri></author><id>https://forge.codesys.comd5bdd9b4d794b6b56e9a5366269744012a102822</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello guys, have a very weird issue and cant help but ask.&lt;br/&gt;
I created the Function with very simple math in it adding two REALS&lt;/p&gt;
&lt;p&gt;Function always returns zero, same code works great with FB but not in a function. &lt;/p&gt;
&lt;h2 id="pou-function-added-to-application-and-then-to-mast-task-under-cyclic-program"&gt;POU Function added to application, and then to Mast task under cyclic program.&lt;/h2&gt;
&lt;p&gt;FUNCTION DIVME : REAL&lt;br/&gt;
VAR_INPUT&lt;br/&gt;
    num01:REAL;&lt;br/&gt;
    num02:REAL;&lt;br/&gt;
END_VAR&lt;br/&gt;
VAR&lt;br/&gt;
END_VAR&lt;/p&gt;
&lt;hr/&gt;
&lt;p&gt;DIVME := (num01+num02);&lt;/p&gt;
&lt;p&gt;When i call this function from the program the result will always be zero regardless of the value of two input parameters. Please guide me to solution&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>