LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

compare columns min and max

Solved!
Go to solution

Untitled.png

 

 

hi, 

i want to compare colum 1,2,5

if max - min > 1 = fail

 

how would i go about doing do?

i am thinking i should just delete all columns with 0s but i am having a difficult time deleting them.

 

Untitled.png

 

can someone guide me how to do it.

thank you

 

 

Untitled.png

0 Kudos
Message 1 of 31
(4,202 Views)

To analyze only valid columns, just iterate over all columns and ignore the colums that contain all zeroes. No need to delete them.

 

Also please attach your actual VI containing typical default data in the array control. We cannot debug pictures.

0 Kudos
Message 2 of 31
(4,187 Views)

 

Download All
0 Kudos
Message 3 of 31
(4,180 Views)

if you have any sugguestion on improving my code. please advise me. i would love to learn something new.

thanks!

 

0 Kudos
Message 4 of 31
(4,177 Views)

It is not clear what you want.  Do you want to take the max and min of all the data in those three columns combined or do you want separate max and min for each column?

 

Why bother with deleting the columns with zeros? max(col[0]) - min(col[0]) = 0.

 

Index through all the columns. Perform Array Max & Min on each column. Then OR (max-min)  > 1 over all the columns. True = Fail.

 

Lynn

0 Kudos
Message 5 of 31
(4,175 Views)

Thanks.

Your custom file IO subVI is missing. What does it do?

 

You have an huge amount of duplicate code and unneeded sequence structures. I think all you probably need is a single loop.

0 Kudos
Message 6 of 31
(4,169 Views)

because if i would look at all the columns with the 0s in it.

 

row 0, max = 23.5 , min = 0 

 

23.5 - 0 = 23.5 >>>>>>>>>>>>> FAIL, because its greater than 1.

 

i dont care for 0s

 

i am only interested in 

 

21.3, 23.5, 22.2

 

max = 23.5

min = 21.3

>>>> 1, failed

 

 

0 Kudos
Message 7 of 31
(4,168 Views)
0 Kudos
Message 8 of 31
(4,162 Views)

@super_saiyans wrote:

because if i would look at all the columns with the 0s in it.


Of course you need to look at the columns with all zeroes one way or the other, but once you see that they are zeroes you can deal with it, right there and not analyze them further, right?

0 Kudos
Message 9 of 31
(4,160 Views)

@super_saiyans wrote:

here you go


You seem to duplicate vi.lib VIs and save them in your own hierarchy. Don't do that!

 

(... now we are missing "read lines from file". is the one you are using different to the stock subVI?)

0 Kudos
Message 10 of 31
(4,154 Views)