LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array + If Else?

I have a 1D array. i have to compared each value which is different every time. If the locations is the same, take the higher amplitude. Can anybody help me to do this? See the attached file if you don't understand what i saying.

0 Kudos
Message 1 of 16
(2,914 Views)

Hi,

"i have to compared each value which is different every time" ,I did not understand. Do you have to compare two array elements?

What is time interval between comparing?

Can you elaborate?

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
0 Kudos
Message 2 of 16
(2,872 Views)

yeah, i have to compare the two array elements for the location.

If two array is the same, it will take the array which is higher for the amplitude.

for time interval, the is no preferences.

if you dont understand, see the attached file.

0 Kudos
Message 3 of 16
(2,867 Views)

Check this.

May be this is what you want to do.

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
0 Kudos
Message 4 of 16
(2,858 Views)

sorry but how do i get the structure outside the case structure?

 

0 Kudos
Message 5 of 16
(2,854 Views)

Hi Tech,

 

I have attached a VI that i think will achieve what you are after. There are 2 vi's in the Zip file. One is the actual VI you need and the other is just an example to show how it works.

 

Hope it helps,

 

Regards,

 

Lucither

------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
0 Kudos
Message 6 of 16
(2,846 Views)

That is an event structure. You may not require it. It depends on when do you want to compare array elements.

If you want to compare elements after some event on the front panel, you can use event structure which is used in example.

You will find event structure in Programming>>Structures palette>> Event structure

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
0 Kudos
Message 7 of 16
(2,845 Views)

Think there may of been a linking error with that file i posted as i changed the vi name just before sending.

 

If there is you can just manually re-link or try this one instead.

 

Rgs,

 

Lucither

------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
0 Kudos
Message 8 of 16
(2,832 Views)

Sorry but i got another question. As the data that my DAQ have more than 3 decimal place. I try putting nearest to integer but there is still decimals. Can i know why?

0 Kudos
Message 9 of 16
(2,703 Views)

Can you explain a bit better what you mean? Are you saying you only want to compare to 3 decimal places and no more ie 12.2342 = 12.2343 ?

 

Rgs

 

Lucither.

------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
0 Kudos
Message 10 of 16
(2,686 Views)