<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Div block</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/cb87577c6f/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/cb87577c6f/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/cb87577c6f/</id><updated>2020-02-27T22:08:48.391000Z</updated><subtitle>Recent posts to Div block</subtitle><entry><title>Div block</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/cb87577c6f/?limit=25#6753" rel="alternate"/><published>2020-02-27T22:08:48.391000Z</published><updated>2020-02-27T22:08:48.391000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.com531f85dd9650c65122093f66dd27a7205a12229a</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;old problem , but display with %1.6f or anything you like.&lt;br/&gt;
yes rounding is also possible, but not accurate.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Div block</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/cb87577c6f/?limit=25#631a" rel="alternate"/><published>2020-02-27T22:08:46.847000Z</published><updated>2020-02-27T22:08:46.847000Z</updated><author><name>Andreaz</name><uri>https://forge.codesys.com/u/andreaz/</uri></author><id>https://forge.codesys.com6bf578e0729324269abdf2a786d219db09afcbe4</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;abyss616 hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
Hello everyone,&lt;br/&gt;
I have a problem. I want to divide one number(Real data type, i need it as real, because numbers behind comma have importance too) with number 3600. How can i do that? When I try to use DIV, I get some kind of number(&lt;strong&gt;&lt;em&gt;*&lt;/em&gt;&lt;/strong&gt;&lt;strong&gt;&lt;em&gt;e-003), even when i try to divide 10.0/3600.0 i get 2,77&lt;/em&gt;&lt;/strong&gt;&lt;em&gt;e-003, although i should get 0.002777&lt;/em&gt;**, is there any possible solution how to scale the output or round it? Thanks for every reply&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Correct result actually:&lt;br/&gt;
2,77777e-003 = 2,77777 *10^-3= 2,77777 * (1/1000) = 0.002777&lt;/p&gt;
&lt;p&gt;So it's only a display thing in the CodeSys debugger.&lt;/p&gt;
&lt;p&gt;&lt;a class="" href="http://en.wikipedia.org/wiki/Scientific_notation" rel="nofollow"&gt;http://en.wikipedia.org/wiki/Scientific_notation&lt;/a&gt; m &lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Div block</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/cb87577c6f/?limit=25#e685" rel="alternate"/><published>2020-02-27T22:08:42.399000Z</published><updated>2020-02-27T22:08:42.399000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.com2ef3d650a5e741b20c9e62f47c1421645a6c9ea9</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;VAR&lt;br/&gt;
inputtime:TIME; (&lt;em&gt; here you start making the difference&lt;/em&gt;)&lt;br/&gt;
inputdivider:real:=3600;  (&lt;em&gt; make sure this is a real variable when you type in th eprogram 3600 it is treated as an INT&lt;/em&gt;)&lt;br/&gt;
workingtime:real; (&lt;em&gt; for holding the converted time just to let you see if it works&lt;/em&gt;)&lt;br/&gt;
outputhours:real;&lt;br/&gt;
END_VAR&lt;/p&gt;
&lt;p&gt;program:&lt;br/&gt;
workingtime:=TIME_TO_REAL(inputtime);&lt;br/&gt;
outputhours:=DIV(workingtime,inputdivider);&lt;/p&gt;
&lt;p&gt;RETURN&lt;br/&gt;
This can best be done in a function block in FBD for example.&lt;br/&gt;
make the inputdivider GLOBAL (put all constants and upthere i use even zero and 1 as reals in GLOBAL&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Div block</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/cb87577c6f/?limit=25#d93d" rel="alternate"/><published>2020-02-27T22:08:40.836000Z</published><updated>2020-02-27T22:08:40.836000Z</updated><author><name>abyss616</name><uri>https://forge.codesys.com/u/abyss616/</uri></author><id>https://forge.codesys.com6677290108c171030d9feb7fb988a9bb874f9173</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello everyone,&lt;br/&gt;
I have a problem. I want to divide one number(Real data type, i need it as real, because numbers behind comma have importance too) with number 3600. How can i do that? When I try to use DIV, I get some kind of number(&lt;strong&gt;&lt;em&gt;*&lt;/em&gt;&lt;/strong&gt;&lt;strong&gt;&lt;em&gt;e-003), even when i try to divide 10.0/3600.0 i get 2,77&lt;/em&gt;&lt;/strong&gt;&lt;em&gt;e-003, although i should get 0.002777&lt;/em&gt;**, is there any possible solution how to scale the output or round it? Thanks for every reply&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>