<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Is it possible to convert a string of 32-bit of binary to a float32?</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/b716235bb6/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Visualization/thread/b716235bb6/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Visualization/thread/b716235bb6/</id><updated>2023-03-23T11:41:40.289000Z</updated><subtitle>Recent posts to Is it possible to convert a string of 32-bit of binary to a float32?</subtitle><entry><title>Is it possible to convert a string of 32-bit of binary to a float32?</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/b716235bb6/?limit=25#3a00" rel="alternate"/><published>2023-03-23T11:41:40.289000Z</published><updated>2023-03-23T11:41:40.289000Z</updated><author><name>kislov</name><uri>https://forge.codesys.com/u/kislov/</uri></author><id>https://forge.codesys.com837f33e695eb5b3eaee34917f7e6700b3aeddd6e</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Lean solution using CAA Memory library.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Is it possible to convert a string of 32-bit of binary to a float32?</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/b716235bb6/?limit=25#cd73" rel="alternate"/><published>2023-03-23T07:09:41.161000Z</published><updated>2023-03-23T07:09:41.161000Z</updated><author><name>marcosote</name><uri>https://forge.codesys.com/u/marcosote/</uri></author><id>https://forge.codesys.com4ed452af67f4e71497214f8dea5a7c06ae05742e</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello everybody,&lt;/p&gt;
&lt;p&gt;I would like to know if it is possible to convert a string of 32-bit with binary data into a float32 data number. &lt;br/&gt;
Example of inputs to the function:&lt;/p&gt;
&lt;p&gt;Input=00111110001000000000000000000000&lt;br/&gt;
Output=0.15625&lt;/p&gt;
&lt;p&gt;The function should follow the rules given in the attached image to convert the string of booleans into a float number:&lt;br/&gt;
&lt;img src="./attachment/Captura.PNG" width="50%"/&gt;&lt;/p&gt;
&lt;p&gt;The reason of this function is because I would like to read from bus REAL data type information. However, between the communication layer and my application software layer, there is another layer developed by someone (which I can't modify) that can only perform implementations type INT and BOOL, meaning that when somebody defines a a REAL data in the communication bus this layer only takes the integer part and sends this info to my application SW layer, loosing all the info related to the floating point.&lt;/p&gt;
&lt;p&gt;Example In/Out of what I have know&lt;/p&gt;
&lt;p&gt;Bus input = 100.12&lt;br/&gt;
Intermediate layer = 100, this info is sent to my SW application layer&lt;br/&gt;
Variable in SW application layer = 100.&lt;/p&gt;
&lt;p&gt;Thanks everybody.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>