<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Data conversion INT to UDINt (double)</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/76466d814e/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/76466d814e/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/76466d814e/</id><updated>2020-02-27T14:25:49.024000Z</updated><subtitle>Recent posts to Data conversion INT to UDINt (double)</subtitle><entry><title>Data conversion INT to UDINt (double)</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/76466d814e/?limit=25#c066" rel="alternate"/><published>2020-02-27T14:25:49.024000Z</published><updated>2020-02-27T14:25:49.024000Z</updated><author><name>Anonymous</name><uri>https://forge.codesys.com/u/*anonymous/</uri></author><id>https://forge.codesys.comcfbf4553d08b88d397ce7cecfd5d8a79b08fda15</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;em&gt;Originally created by:&lt;/em&gt; Massimo.Milluzzo&lt;/p&gt;
&lt;p&gt;The function you are looking for is INT_TO_UDINT.&lt;/p&gt;
&lt;p&gt;Another way to visualize the value 123,45 from an integer is to set, as text variable displayed, the code &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;INT_TO_REAL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;yourVariable&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;The conversion to REAL is required in order to "enable" the decimal values.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Data conversion INT to UDINt (double)</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/76466d814e/?limit=25#957c" rel="alternate"/><published>2020-02-27T14:25:48.364000Z</published><updated>2020-02-27T14:25:48.364000Z</updated><author><name>beamster</name><uri>https://forge.codesys.com/u/beamster/</uri></author><id>https://forge.codesys.com6ae945b5aec806840e3051ea37e3d162ddeaf630</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I'm a n00b to Codesys programming, so sorry in advance if my question is a bit stupid &lt;br/&gt;
This is probably not a dedicated V3-question, but since I'm working in V3.5 SP10 I guess I should post my question here anyway?!&lt;/p&gt;
&lt;p&gt;I work with a Seeeduino CAN-Bus shield mounted on Arduino (sender) and a Opus A3 Display (receiver). Im sending INT values of max value of 65365 (2 bytes) with CAN to the display. Like an example: Im sending INT x =12345 to the display and give it to a global variable global_x(INT) and show it on the display. This works. &lt;/p&gt;
&lt;p&gt;But now I want to convert this integer to a double. I think in CodeSys you need to use UDINT? Because I want to display 123,45 (12345/100). I tried to give the value of global_x to a local variable (UDINT) and divide by 100. But this is not working when I want to show it on my display.&lt;/p&gt;
&lt;p&gt;Maybe someone has a clue? Or is there a way to convert an INT to a UDINT (double) in Codesys when you declare a local variable?? Or do I have to give UDINT to my global_x also ?&lt;/p&gt;
&lt;p&gt;With kind regards,&lt;/p&gt;
&lt;p&gt;beamster&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>