<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to compare bool arrays</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/ae2269a13b/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/ae2269a13b/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/ae2269a13b/</id><updated>2020-02-27T14:05:47.682000Z</updated><subtitle>Recent posts to compare bool arrays</subtitle><entry><title>compare bool arrays</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/ae2269a13b/?limit=25#16db" rel="alternate"/><published>2020-02-27T14:05:47.682000Z</published><updated>2020-02-27T14:05:47.682000Z</updated><author><name>nikk4s</name><uri>https://forge.codesys.com/u/nikk4s/</uri></author><id>https://forge.codesys.com0e15e5e39e36bfe129bebb103cfe72da57b74183</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thank you. I changed array&lt;span&gt;[0..15]&lt;/span&gt; of Bool to array&lt;span&gt;[0..0]&lt;/span&gt; of INT. These I can compare with math operators. &lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>compare bool arrays</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/ae2269a13b/?limit=25#b3a4" rel="alternate"/><published>2020-02-27T14:05:46.783000Z</published><updated>2020-02-27T14:05:46.783000Z</updated><author><name>Anonymous</name><uri>https://forge.codesys.com/u/*anonymous/</uri></author><id>https://forge.codesys.comc452ade96189d447374e868ba0f7d421369227f3</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;em&gt;Originally created by:&lt;/em&gt; scott_cunningham&lt;/p&gt;
&lt;p&gt;A BOOL is not a BIT (BOOLs in CoDeSys are byte-sized by default).  So you are really trying to compare a structure (a chunk of bytes). IF Struct1 = Struct2 will not work - you cannot also do Struct1 := Struct2. You have to compare each element. Your hardware source or the system libraries should have a function (for copy, I know there is a SysMemCopy or something like that). Sorry, I am not in front of my PC, so I cannot give you the exact item.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>compare bool arrays</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/ae2269a13b/?limit=25#7c6c" rel="alternate"/><published>2020-02-27T14:05:46.462000Z</published><updated>2020-02-27T14:05:46.462000Z</updated><author><name>nikk4s</name><uri>https://forge.codesys.com/u/nikk4s/</uri></author><id>https://forge.codesys.com93a065941e22ad653e3acddbbccfaa22f763e100</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;rjafrate hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
Correct declaration of bool array may help.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;key_alarms&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;0&lt;/span&gt;&lt;span class="o"&gt;..&lt;/span&gt;&lt;span class="mi"&gt;15&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;no_alarms&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;0&lt;/span&gt;&lt;span class="o"&gt;..&lt;/span&gt;&lt;span class="mi"&gt;15&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;/pre&gt;&lt;/div&gt;


&lt;p&gt;I declared as you said.  Still have the same issue.  In logix I think this is a file bit compare FBC function.  Cannot seem to find the similar functiion for codesys.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>compare bool arrays</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/ae2269a13b/?limit=25#500a" rel="alternate"/><published>2020-02-27T14:05:46.140000Z</published><updated>2020-02-27T14:05:46.140000Z</updated><author><name>rickj</name><uri>https://forge.codesys.com/u/rickj/</uri></author><id>https://forge.codesys.com1f6c2cc67fbcf17b9ccb886016ef70974ab0e0df</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Correct declaration of bool array may help.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;key_alarms&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;0&lt;/span&gt;&lt;span class="o"&gt;..&lt;/span&gt;&lt;span class="mi"&gt;15&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;no_alarms&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;0&lt;/span&gt;&lt;span class="o"&gt;..&lt;/span&gt;&lt;span class="mi"&gt;15&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;/pre&gt;&lt;/div&gt;

&lt;/div&gt;</summary></entry><entry><title>compare bool arrays</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/ae2269a13b/?limit=25#0e67" rel="alternate"/><published>2020-02-27T14:05:45.792000Z</published><updated>2020-02-27T14:05:45.792000Z</updated><author><name>nikk4s</name><uri>https://forge.codesys.com/u/nikk4s/</uri></author><id>https://forge.codesys.com2bd0bb0e1670ee41a1f05251b739e76884ed9b45</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I have 2 bool arrays&lt;br/&gt;
key_alarms: ARRAY&lt;span&gt;[0..0]&lt;/span&gt; OF ARRAY&lt;span&gt;[0..15]&lt;/span&gt; OF bool;&lt;br/&gt;
no_alarms: ARRAY&lt;span&gt;[0..0]&lt;/span&gt; OF ARRAY&lt;span&gt;[0..15]&lt;/span&gt; OF bool;&lt;br/&gt;
no_alarms is an empty array -all false or all 0's&lt;br/&gt;
I would like to compare that if any bool of key_alarms is high/true/1, set another bit.&lt;br/&gt;
I have tried GT and NE functions with these 2 arrays as inputs and receive an error as below.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;           &lt;span class="c1"&gt;------ Build started: Application: Device.Application -------&lt;/span&gt;
            &lt;span class="n"&gt;typify&lt;/span&gt; &lt;span class="n"&gt;code&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;span&gt;[ERROR]&lt;/span&gt;         garagepi: key_faults &lt;a class="" href="../Network%2016%20/%20Operator%20'NE'%20(Impl)"&gt;Device: PLC Logic: Application&lt;/a&gt;: C0068:  Compare not possible on objects of type 'ARRAY &lt;span&gt;[0..0]&lt;/span&gt; OF ARRAY &lt;span&gt;[0..15]&lt;/span&gt; OF BOOL'&lt;/p&gt;
&lt;p&gt;What function would allow me to compare these 2 arrays of inputs within a ladder program?&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>