<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to SINT / SINT into REAL - incorrect result</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/493c340d5e/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/493c340d5e/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/493c340d5e/</id><updated>2020-02-27T14:01:31.771000Z</updated><subtitle>Recent posts to SINT / SINT into REAL - incorrect result</subtitle><entry><title>SINT / SINT into REAL - incorrect result</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/493c340d5e/?limit=25#c155" rel="alternate"/><published>2020-02-27T14:01:31.771000Z</published><updated>2020-02-27T14:01:31.771000Z</updated><author><name>Biggles</name><uri>https://forge.codesys.com/u/biggles/</uri></author><id>https://forge.codesys.comfd4f67ae4dda793f47be0aa0bdc6eedbaecd17e9</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thanks Alfred!&lt;/p&gt;
&lt;p&gt;Embarrassingly I just realised the same just before you posted your kind reply!&lt;br/&gt;
Its been a while and sometime it's a case of "If you don't use it.....you lose it!"&lt;/p&gt;
&lt;p&gt;Hopefully with more practice some of it will come back.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>SINT / SINT into REAL - incorrect result</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/493c340d5e/?limit=25#a8e3" rel="alternate"/><published>2020-02-27T14:01:31.505000Z</published><updated>2020-02-27T14:01:31.505000Z</updated><author><name>alwoso</name><uri>https://forge.codesys.com/u/alwoso/</uri></author><id>https://forge.codesys.com33aa8d5fd7fe78d16fbcb61e0fdba81f2d330ad3</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi Biggles!&lt;/p&gt;
&lt;p&gt;To get a REAL result, you have to do the calculation in REAL. So just convert the SINTs into REAL and do the calculation then:&lt;/p&gt;
&lt;p&gt;rResult:   REAL;&lt;br/&gt;
siInput1:  SINT;&lt;br/&gt;
siInput2:  SINT;&lt;/p&gt;
&lt;p&gt;rResult:= SINT_TO_REAL(siInput1) / SINT_TO_REAL(siInput2);&lt;/p&gt;
&lt;p&gt;That should work!&lt;/p&gt;
&lt;p&gt;Alfred&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>SINT / SINT into REAL - incorrect result</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/493c340d5e/?limit=25#9f56" rel="alternate"/><published>2020-02-27T14:01:30.712000Z</published><updated>2020-02-27T14:01:30.712000Z</updated><author><name>Biggles</name><uri>https://forge.codesys.com/u/biggles/</uri></author><id>https://forge.codesys.com99405b3cde5f3e554f3f7ff0ade9a3f397bbb0f3</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Newbie Question!&lt;/p&gt;
&lt;p&gt;Hi all, I am returning to using PLC's after not having used them for some 20 odd years. My have things changed!&lt;br/&gt;
I'm new to CodeSys and am writing a simple program in ST to learn the IDE and test my old skills.&lt;/p&gt;
&lt;p&gt;Clearly they're not very good.&lt;/p&gt;
&lt;p&gt;I am try to divide two declared signed integer variables and store in a REAL variable i.e.140 / 16&lt;br/&gt;
The answer should be 8.75 but when I run the program in simulation the real variable shows only the 8 with no decimal place or anything thereafter.&lt;/p&gt;
&lt;p&gt;Can anyone help with what am I doing wrong please?&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>