LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

compare elements

Solved!
Go to solution

How do I comare elements in an array and output a T/F?   I want to stop my while loop IF two elements in the array are equal.

Eric Yuzon
Senior engineer
ERC
Walled Lake, MI 48390
ericyuzon@e-reman.com
e-reman.com
0 Kudos
Message 1 of 15
(2,208 Views)
Solution
Accepted by topic author bteed@dormanproducts.com

Like this with a equal and OR Array Elements function. Make sure the Equal function is set to compare elements and make sure the data type you are comparing is an integer type.

 

0 Kudos
Message 2 of 15
(2,198 Views)

what is the second compare?  i cant find it?

Eric Yuzon
Senior engineer
ERC
Walled Lake, MI 48390
ericyuzon@e-reman.com
e-reman.com
0 Kudos
Message 3 of 15
(2,188 Views)

OR Array Elements like I said.

 

See the 'Search' button on the Functions palette? You can use that. It also seems that you are using LabVIWE 2009. That image is a 'snippet'. You just have to drag it to a block diagram.

0 Kudos
Message 4 of 15
(2,180 Views)

I found it!   Thanks!

Eric Yuzon
Senior engineer
ERC
Walled Lake, MI 48390
ericyuzon@e-reman.com
e-reman.com
0 Kudos
Message 5 of 15
(2,171 Views)

Now my next question is related but more involved.   How do I do a bitwise compare within the element?   Maybe a bit mask of some sort?

Eric Yuzon
Senior engineer
ERC
Walled Lake, MI 48390
ericyuzon@e-reman.com
e-reman.com
0 Kudos
Message 6 of 15
(2,164 Views)

Yes, you can use a mask..

 

I'm a little confused...  Do you want to implement that as part of the code example Denis provided?  Or is it a different topic?

0 Kudos
Message 7 of 15
(2,160 Views)

The code works for the hex compares.  Now I have to use the same code modified for bit compares.  How do I implement a bit mask?

Eric Yuzon
Senior engineer
ERC
Walled Lake, MI 48390
ericyuzon@e-reman.com
e-reman.com
0 Kudos
Message 8 of 15
(2,143 Views)

Here is an example of how to do several things concerning bit masking.

 

18499iC28F61102189BA7D

- tbob

Inventor of the WORM Global
0 Kudos
Message 9 of 15
(2,132 Views)

Example_VI.png

 

 

You simple AND them together..

0 Kudos
Message 10 of 15
(2,130 Views)