<?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/98cb3f5507/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/98cb3f5507/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/98cb3f5507/</id><updated>2021-03-16T21:13:29.809000Z</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/98cb3f5507/?limit=25#7ed4" rel="alternate"/><published>2021-03-16T21:13:29.809000Z</published><updated>2021-03-16T21:13:29.809000Z</updated><author><name>alex</name><uri>https://forge.codesys.com/u/alex/</uri></author><id>https://forge.codesys.com6f67cb606d22db50548533a84c16a774420175ec</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>