<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Data conversion+</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/633a1bf0cc/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/633a1bf0cc/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/633a1bf0cc/</id><updated>2020-02-27T14:09:03.560000Z</updated><subtitle>Recent posts to Data conversion+</subtitle><entry><title>Data conversion+</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/633a1bf0cc/?limit=25#9d5f" rel="alternate"/><published>2020-02-27T14:09:03.560000Z</published><updated>2020-02-27T14:09:03.560000Z</updated><author><name>Joan M</name><uri>https://forge.codesys.com/u/joan-m/</uri></author><id>https://forge.codesys.com1d821f5ce66c9393f246b0e0134ec085730b52fd</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I've found another way to do this: you can add the library Util and it's EXTRACT function which allows you to use a variable to specify the position you want from a DWORD, WORD...&lt;/p&gt;
&lt;p&gt;Good luck!&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Data conversion+</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/633a1bf0cc/?limit=25#48fa" rel="alternate"/><published>2020-02-27T14:09:03.211000Z</published><updated>2020-02-27T14:09:03.211000Z</updated><author><name>Joan M</name><uri>https://forge.codesys.com/u/joan-m/</uri></author><id>https://forge.codesys.comcf4b51b1198d824d51a81a6f87b22e344d10cf68</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Never a question is stupid.&lt;/p&gt;
&lt;p&gt;You can do what is suggested before:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;variable.bit (in certain numeric variable types).&lt;/li&gt;
&lt;li&gt;Declare a variable for each position (given we are speaking of inputs/outputs that you can address).&lt;/li&gt;
&lt;li&gt;Create a pointer to an array of bools with the same bit length for that variable and point it to the variable itself.&lt;br/&gt;
** This last option can be improved if you put that inside a function, you declare the array without limits and pass the address and sizeof of the variable to be examined.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Hope this helps!&lt;/p&gt;
&lt;p&gt;Happy new year...&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Data conversion+</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/633a1bf0cc/?limit=25#29b9" rel="alternate"/><published>2020-02-27T14:09:02.837000Z</published><updated>2020-02-27T14:09:02.837000Z</updated><author><name>camferti</name><uri>https://forge.codesys.com/u/camferti/</uri></author><id>https://forge.codesys.combc9e72bf08cb6b90cb98f35a32775d40b1ea4d7d</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Kallamamran hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
Hello,&lt;br/&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 SP8 Patch 1 I guess I should post my question here anyway?!&lt;br/&gt;
I have searched the forum and on the internets without finding the correct information to let me continue with my program.&lt;br/&gt;
I'm reading a number (1-50) from a tag and now I want to take the binary version of that number and output it to 8 outputs (%QX1.0 to 1.7).&lt;br/&gt;
One of the problems is I don't know how to get the boolean values of each bit in the byte to transfer to the output module?&lt;br/&gt;
Any ideas? &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;You can also declare individual variables for da bit&lt;/p&gt;
&lt;p&gt;var1 at %ix1.1 :bool;&lt;br/&gt;
In this way you refer to individually bit&lt;br/&gt;
good luck&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Data conversion+</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/633a1bf0cc/?limit=25#4fb1" rel="alternate"/><published>2020-02-27T14:09:01.897000Z</published><updated>2020-02-27T14:09:01.897000Z</updated><author><name>Comingback4u</name><uri>https://forge.codesys.com/u/comingback4u/</uri></author><id>https://forge.codesys.com8fa6156a4ec48fc34f625f6719c1f16efcac70db</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;It sounds like what you are looking for is on your outputs you would access the tag variable then add .&amp;lt;bitindex&amp;gt; after that variable.&amp;lt;/bitindex&amp;gt;&lt;/p&gt;
&lt;p&gt;QX1.0 := Tag.0;&lt;br/&gt;
......&lt;br/&gt;
QX1.7 := Tag.7;&lt;/p&gt;
&lt;p&gt;Look under help "Programming Reference &amp;gt; Operands &amp;gt; Variables &amp;gt; Addressing bits in variables" to get maybe a better understanding.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Data conversion+</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/633a1bf0cc/?limit=25#5d05" rel="alternate"/><published>2020-02-27T14:09:01.577000Z</published><updated>2020-02-27T14:09:01.577000Z</updated><author><name>Kallamamran</name><uri>https://forge.codesys.com/u/kallamamran/</uri></author><id>https://forge.codesys.comcc7bbeed9e000325aa757a5ff3d65a9a2ff96e0b</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 SP8 Patch 1 I guess I should post my question here anyway?!&lt;/p&gt;
&lt;p&gt;I have searched the forum and on the internets without finding the correct information to let me continue with my program.&lt;br/&gt;
I'm reading a number (1-50) from a tag and now I want to take the binary version of that number and output it to 8 outputs (%QX1.0 to 1.7).&lt;br/&gt;
One of the problems is I don't know how to get the boolean values of each bit in the byte to transfer to the output module?&lt;/p&gt;
&lt;p&gt;Any ideas? &lt;/p&gt;&lt;/div&gt;</summary></entry></feed>