<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to About the data type conversion</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/9eab4cf74a/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/9eab4cf74a/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/9eab4cf74a/</id><updated>2020-02-27T13:56:58.800000Z</updated><subtitle>Recent posts to About the data type conversion</subtitle><entry><title>About the data type conversion</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/9eab4cf74a/?limit=25#bb96" rel="alternate"/><published>2020-02-27T13:56:58.800000Z</published><updated>2020-02-27T13:56:58.800000Z</updated><author><name>Anonymous</name><uri>https://forge.codesys.com/u/*anonymous/</uri></author><id>https://forge.codesys.com4d0fab856e74249c6d3dd4eec298caa91c9cc1f4</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;em&gt;Originally created by:&lt;/em&gt; M.Schaber&lt;/p&gt;
&lt;p&gt;Hi, skytianlin,&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;skytianlin hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
I want to kown whether I can take a funciton, such as "real_to_int" to convert the DINT to DWORD by CoDeSys.&lt;br/&gt;
I have tried to use the keyword for DINT_TO_DWORD, but it can be realized by CoDeSys.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The type conversion functions are documentet in the online help, there is a chapter about type conversion operators.&lt;/p&gt;
&lt;p&gt;In your case, the ANY_TO_INT() should work:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;re&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;REAL&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="mf"&gt;1.234&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; 
&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;INT&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;ANY_TO_INT&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;/div&gt;</summary></entry><entry><title>About the data type conversion</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/9eab4cf74a/?limit=25#992c" rel="alternate"/><published>2020-02-27T13:56:58.584000Z</published><updated>2020-02-27T13:56:58.584000Z</updated><author><name>skytianlin</name><uri>https://forge.codesys.com/u/skytianlin/</uri></author><id>https://forge.codesys.com4130ef302fe72dba10a43ba473fc9b3a8cf08e7e</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi! engineers:&lt;br/&gt;
     I want to kown whether I can take a funciton, such as "real_to_int" to convert the DINT to DWORD by CoDeSys.&lt;br/&gt;
I have tried to use the keyword for DINT_TO_DWORD, but it can be realized by CoDeSys.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>