<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Operator DIV</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/977d04d004/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/977d04d004/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/977d04d004/</id><updated>2020-02-27T22:52:59.886000Z</updated><subtitle>Recent posts to Operator DIV</subtitle><entry><title>Operator DIV</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/977d04d004/?limit=25#3cd5" rel="alternate"/><published>2020-02-27T22:52:59.886000Z</published><updated>2020-02-27T22:52:59.886000Z</updated><author><name>Dutch</name><uri>https://forge.codesys.com/u/dutch/</uri></author><id>https://forge.codesys.com9f8c48eafe9e67b3363286e828f1700b379c823a</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thank you for the quick reply.&lt;/p&gt;
&lt;p&gt;Issue is solved.&lt;/p&gt;
&lt;p&gt;I had declared  IN1   AT %IW0: REAL;  &lt;/p&gt;
&lt;p&gt;Went over this 100 times. Turns out I had a corrupt&lt;/p&gt;
&lt;p&gt;version.&lt;/p&gt;
&lt;p&gt;Started a new one, everything's fine.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Operator DIV</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/977d04d004/?limit=25#ca1e" rel="alternate"/><published>2020-02-27T22:52:55.379000Z</published><updated>2020-02-27T22:52:55.379000Z</updated><author><name>Nitrozin</name><uri>https://forge.codesys.com/u/nitrozin/</uri></author><id>https://forge.codesys.comd52ad96a9727f430c87c0b924889057fb1ea4cb2</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;try this.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nt"&gt;FUNCTION&lt;/span&gt; &lt;span class="nt"&gt;DIVI&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;REAL&lt;/span&gt;
&lt;span class="nt"&gt;VAR_INPUT&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="nt"&gt;IN1&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;WORD&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="nt"&gt;IN2&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;WORD&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;END_VAR&lt;/span&gt;
&lt;span class="nt"&gt;VAR&lt;/span&gt;
&lt;span class="nt"&gt;END_VAR&lt;/span&gt;
&lt;span class="nt"&gt;DIVI&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;WORD_TO_REAL&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;IN1&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nt"&gt;WORD_TO_REAL&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;IN2&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;regards Nitro&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Operator DIV</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/977d04d004/?limit=25#1e21" rel="alternate"/><published>2020-02-27T22:52:53.520000Z</published><updated>2020-02-27T22:52:53.520000Z</updated><author><name>Dutch</name><uri>https://forge.codesys.com/u/dutch/</uri></author><id>https://forge.codesys.comacf5db1a94072ed56fd064447c06f8146fe2d2cf</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Some months ago I had this working just fine!&lt;/p&gt;
&lt;p&gt;Suddenly have developed amnesia on how to use the DIV Operator and end up with a decimal number.&lt;/p&gt;
&lt;p&gt;As in 32767/32767=1&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;    &lt;span class="mi"&gt;32767&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;22222&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;474529&lt;/span&gt;

    &lt;span class="mi"&gt;22222&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;32767&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;6781823&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;I have tried every combination of data type: INT, WORD, REAL you name it.&lt;/p&gt;
&lt;p&gt;I can only ever end up with a 1 or a 0.&lt;/p&gt;
&lt;p&gt;IN1 and IN2 are Presently WORD at %IW0 and %IW2&lt;/p&gt;
&lt;p&gt;Can anyone refresh my memory?&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>