annuler
Affichage des résultats de 
Rechercher plutôt 
Vouliez-vous dire : 

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 Compliments
Message 1 sur 16
3 906 Visites

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 Compliments
Message 2 sur 16
3 864 Visites

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 Compliments
Message 3 sur 16
3 859 Visites

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 Compliments
Message 4 sur 16
3 850 Visites

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

 

0 Compliments
Message 5 sur 16
3 846 Visites

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 Compliments
Message 6 sur 16
3 838 Visites

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 Compliments
Message 7 sur 16
3 837 Visites

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 Compliments
Message 8 sur 16
3 824 Visites

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 Compliments
Message 9 sur 16
3 695 Visites

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 Compliments
Message 10 sur 16
3 678 Visites