<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Real to word conversion for analog outputs</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/5652965ea8/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/5652965ea8/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/5652965ea8/</id><updated>2020-02-27T23:06:08.166000Z</updated><subtitle>Recent posts to Real to word conversion for analog outputs</subtitle><entry><title>Real to word conversion for analog outputs</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/5652965ea8/?limit=25#7dcf" rel="alternate"/><published>2020-02-27T23:06:08.166000Z</published><updated>2020-02-27T23:06:08.166000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.com4eff5897256f2925a30793e1ec1bc6298eaafa26</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;The word output is sometimes strangely formatted.&lt;br/&gt;
but in general the conversion like ndzied tells is working,&lt;br/&gt;
Inputs are sometimes shifted so will need special attention before scaling.&lt;/p&gt;
&lt;p&gt;Have a look at the oscat library with many functions for this.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Real to word conversion for analog outputs</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/5652965ea8/?limit=25#4796" rel="alternate"/><published>2020-02-27T23:06:06.489000Z</published><updated>2020-02-27T23:06:06.489000Z</updated><author><name>ndzied1</name><uri>https://forge.codesys.com/u/ndzied1/</uri></author><id>https://forge.codesys.com175ef99c23fc817c69ec1fdf028bbb8b2d2dfcaa</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;The standard includes a REAL_TO_WORD() function.  You only need to check with your hardware documentation to see what numerical value corresponds to the real world voltage or current signals.&lt;/p&gt;
&lt;p&gt;Usually you perform a scaling function first to create the number you need to send to the analog output, for instance, a 12 bit analog output would likely take numbers from 0 to 4095.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Real to word conversion for analog outputs</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/5652965ea8/?limit=25#e259" rel="alternate"/><published>2020-02-27T23:06:01.986000Z</published><updated>2020-02-27T23:06:01.986000Z</updated><author><name>CME</name><uri>https://forge.codesys.com/u/cme/</uri></author><id>https://forge.codesys.comd9398ec66c175f71d9d4f6f8f97e32f94362b53b</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Most of the libraries for analog processing ( 0-10V, 4-20mA…) are using “real” as output.  For an analog output module you need a datatype “word”.  How can I easily convert real to word?&lt;br/&gt;
Does a library exist with a function REAL_TO_WORD  function?&lt;/p&gt;
&lt;p&gt;I think it must be also possible with pointers but have anyone experience with it and/or having a example program?&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>