<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Pointer ARRAY BYTE to ARRAY BOOL</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/1701f6f313/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/1701f6f313/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/1701f6f313/</id><updated>2020-02-27T23:09:20.534000Z</updated><subtitle>Recent posts to Pointer ARRAY BYTE to ARRAY BOOL</subtitle><entry><title>Pointer ARRAY BYTE to ARRAY BOOL</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/1701f6f313/?limit=25#7e04" rel="alternate"/><published>2020-02-27T23:09:20.534000Z</published><updated>2020-02-27T23:09:20.534000Z</updated><author><name>hugo</name><uri>https://forge.codesys.com/u/hugo/</uri></author><id>https://forge.codesys.com2e764903c752880b113053dd51cddbc9e21927be</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;True you can only reference a bit by a constant not ba a variable&lt;/p&gt;
&lt;p&gt;a simple trick is to do the following:&lt;/p&gt;
&lt;p&gt;tmp := shr(INbyte, N);&lt;/p&gt;
&lt;p&gt;Bit := tmp.0;&lt;/p&gt;
&lt;p&gt;in the open source library OSCAT.LIB you can find functions like this to get a bit referenced by a variable.&lt;/p&gt;
&lt;p&gt;w &lt;a class="" href="http://www.oscat.de" rel="nofollow"&gt;www.oscat.de&lt;/a&gt; w &lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Pointer ARRAY BYTE to ARRAY BOOL</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/1701f6f313/?limit=25#b5d6" rel="alternate"/><published>2020-02-27T23:09:18.942000Z</published><updated>2020-02-27T23:09:18.942000Z</updated><author><name>spfeif</name><uri>https://forge.codesys.com/u/spfeif/</uri></author><id>https://forge.codesys.comec5dc957cdd2b45f7de39da4410e1dd382f05d2b</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;What specifically are you trying to accomplish? Maybe there is a better way of doing it. Also CoDeSys is not case sensitive, it appears to me that you have the same variable defined twice.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Pointer ARRAY BYTE to ARRAY BOOL</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/1701f6f313/?limit=25#7752" rel="alternate"/><published>2020-02-27T23:09:14.453000Z</published><updated>2020-02-27T23:09:14.453000Z</updated><author><name>Paul</name><uri>https://forge.codesys.com/u/paul/</uri></author><id>https://forge.codesys.com924f7fd0708f5d70a636d422d442606af08db81b</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;But I need access over some variable. Buffer&lt;span&gt;[0]&lt;/span&gt;.somevar is not possible.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Pointer ARRAY BYTE to ARRAY BOOL</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/1701f6f313/?limit=25#1980" rel="alternate"/><published>2020-02-27T23:09:12.779000Z</published><updated>2020-02-27T23:09:12.779000Z</updated><author><name>Ralph Holz</name><uri>https://forge.codesys.com/u/ralph-holz/</uri></author><id>https://forge.codesys.com2bee3e59541514e8c39cf3fabef6b06ee3297505</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi Paul,&lt;/p&gt;
&lt;p&gt;Thats a quite normal behavior in CoDeSys. A boolean needs a byte of memory space so your pointer points to the 20 first bytes. Whats about typing ```&lt;/p&gt;
&lt;p&gt;buffer&lt;span&gt;[1]&lt;/span&gt;.0&lt;/p&gt;
&lt;p&gt;```? This code accesses the first bit of first index.&lt;/p&gt;
&lt;p&gt;regards &lt;/p&gt;
&lt;p&gt;Ralph&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Pointer ARRAY BYTE to ARRAY BOOL</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/1701f6f313/?limit=25#7606" rel="alternate"/><published>2020-02-27T23:09:08.210000Z</published><updated>2020-02-27T23:09:08.210000Z</updated><author><name>Paul</name><uri>https://forge.codesys.com/u/paul/</uri></author><id>https://forge.codesys.come3acdec83f1b46328d7b2037a3776d34c232a69e</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi, &lt;/p&gt;
&lt;p&gt;I have &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;buffer&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;ARRAY&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;..&lt;/span&gt;&lt;span class="mi"&gt;1024&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="n"&gt;OF&lt;/span&gt; &lt;span class="n"&gt;BYTE&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;and need bit access in to small part this array, I created this:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;Jednotky&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;POINTER&lt;/span&gt; &lt;span class="n"&gt;TO&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="n"&gt;ARRAY&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;..&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="n"&gt;OF&lt;/span&gt; &lt;span class="n"&gt;BOOL&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;jednotky&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;ARRAY&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;..&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="n"&gt;OF&lt;/span&gt; &lt;span class="n"&gt;BOOL&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;pJednotky&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;ADR&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;buffer&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;Jednotky&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;pJednotky&lt;/span&gt;&lt;span class="o"&gt;^;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;At view array jednotky :&lt;/p&gt;
&lt;p&gt;Jdnotka&lt;span&gt;[1]&lt;/span&gt; : BOOL := &lt;strong&gt;&lt;em&gt; INVALID 16#F0 &lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Jdnotka&lt;span&gt;[2]&lt;/span&gt; : BOOL := &lt;strong&gt;&lt;em&gt; INVALID 16#F3 &lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Jdnotka&lt;span&gt;[3]&lt;/span&gt; : BOOL := false;&lt;/p&gt;
&lt;p&gt;It's number contains in buffer. But i Think that CoDeSys partitions on 20 singl bits. Way? How to repair?&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>