<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Any data type</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/28c3cd39f9/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/28c3cd39f9/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/28c3cd39f9/</id><updated>2020-02-27T14:08:13.726000Z</updated><subtitle>Recent posts to Any data type</subtitle><entry><title>Any data type</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/28c3cd39f9/?limit=25#1c62" rel="alternate"/><published>2020-02-27T14:08:13.726000Z</published><updated>2020-02-27T14:08:13.726000Z</updated><author><name>tzygmunt</name><uri>https://forge.codesys.com/u/tzygmunt/</uri></author><id>https://forge.codesys.com744bcc1832a015d2f77d1e2f221ac66a1e38d806</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I found a work around that should work for my application.&lt;/p&gt;
&lt;p&gt;If I have the input parameter as a LReal CODESYS will automatically type cast from any number or constant to LReal without loss of data.&lt;/p&gt;
&lt;p&gt;I define my destination parameter as type 'Any', and cast the result into the destination data type.&lt;/p&gt;
&lt;p&gt;This seems to work with the testing that I have done at this time.&lt;/p&gt;
&lt;p&gt;An example of this running with multiple data types is attached.&lt;/p&gt;
&lt;p&gt;&lt;a class="" href="https://forum.codesys.com//download/file.php?id=4518" rel="nofollow"&gt;TestFunction.pdf &lt;span&gt;&lt;span&gt;[14.95 KiB]&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Any data type</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/28c3cd39f9/?limit=25#fb6f" rel="alternate"/><published>2020-02-27T14:08:13.417000Z</published><updated>2020-02-27T14:08:13.417000Z</updated><author><name>dFx</name><uri>https://forge.codesys.com/u/dfx/</uri></author><id>https://forge.codesys.comee050d4c4833e0a80eed2e472580f69ca97bb7b1</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Constants are part of your compiled code, while variables are memory address. I think this is why you can't use any for constants.&lt;br/&gt;
Move is a value change operation, meaning it expects a value at the in parameter, and a memory address at the out one. &lt;br/&gt;
Btw, I have no clue how it handles the input declaration.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Any data type</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/28c3cd39f9/?limit=25#5333" rel="alternate"/><published>2020-02-27T14:08:13.116000Z</published><updated>2020-02-27T14:08:13.116000Z</updated><author><name>tzygmunt</name><uri>https://forge.codesys.com/u/tzygmunt/</uri></author><id>https://forge.codesys.comf73ad81ce3effa2d1bc7d05eb5f292b37a118aba</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I would like to create a function block that can use multiple data types and constants.  For example I would like to be able to pass in int, dint, uint, udint data types.&lt;/p&gt;
&lt;p&gt;I can do this using the 'any' data type in my Var_input of the function block.  The only problem is that it will not let me pass in a constant to the function block (see attachment).&lt;/p&gt;
&lt;p&gt;There must be a way to do multi data_type/constant parameters.  The Move function block accepts multiple datatypes and constants.  How does the Move do this?&lt;/p&gt;
&lt;p&gt;&lt;a class="" href="https://forum.codesys.com//download/file.php?id=4514" rel="nofollow"&gt;Any Data_type.pdf &lt;span&gt;&lt;span&gt;[44.68 KiB]&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>