LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to compare elements in 1 array

Hi, 

 

I need a way to compare 5 elements with eachother.

When one or more elements are the same it needs to give me a boolean output.

But the compare has to exclude 0.

 

In the attached VI the elements I need to compare are the Identifiers. 

I warn you my VI is verry messy. 

 

I've tried allot of things, but can't seem to figure something out. 

 

hoping for a quick answer

Lore Maris

Student

KDG Antwerp 

Belgium

 

0 Kudos
Message 1 of 3
(3,422 Views)

Ok, let's simplify things to just your exact problem.  There is just too much noise in that VI to figure out where your problem is.

 

So create a very simple VI that shows what your inputs are and the desired output.  Be sure to save the example data as the default values.

 

At the top of my head, I think you are going to need a FOR for to autoindex the array and use Search 1D Array inside of the FOR loop to look for duplicates.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 3
(3,392 Views)

How about sort 1-D array.  Use Array Subset to get two arrays starting from 0 and starting from element 1.  Compare them for equality element by element.  OR array elements.  If there are any duplicates, they'd wind up next to each other after sorting, and you'd get a True somwhere along the array when comparing side by side elements.

0 Kudos
Message 3 of 3
(3,382 Views)