LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I average data within a range of x when y is over a certain value?

Solved!
Go to solution

Hi,

 

 

I'm relatively new to LabVIEW and haven't found any simple solution to this so I'd appreciate any help. I have a graph plotted which displays force over time. A weight is dropped which causes a sharp spike in the graph, then it settles over time. I need to average all the data which is plotted between the time that the force first rises above a certain value and the time that the force first drops back below this same value. The data may then come back up above that trigger value but it only needs to be averaged until it drops below the trigger for the first time.

 

 

 

Any help is greatly appreciated.

0 Kudos
Message 1 of 29
(5,015 Views)
Do you have any code written? Also do you have any data that we could look at?
Tim
GHSP
0 Kudos
Message 2 of 29
(5,008 Views)

Right now the program writes out to an excel spreadsheet, a simple one column file of force values:

 

 

0
0
34
186
288
418
603
891
995
1056
983
671
488
302

 

We're then taking that data, selecting the forces within our range (in this case 603 -> 671) and doing an average() in excel.

 

In short, there's nothing programmed to handle the data itself.

 

We need LV to select that data, average it, and display the average for that region.

 

 

 

Thanks,

 

Justin

0 Kudos
Message 3 of 29
(5,000 Views)

Edit: first try was garbage...ill try again 🙂

Message Edited by for(imstuck) on 11-11-2009 11:34 AM
0 Kudos
Message 4 of 29
(4,982 Views)
If you use the VI I posted here you can get where the peak starts and ends.  With very little modification you can do exactly what you want.  You can use the left edge, span and Array Subset to get the values that make up the peak.
--
Tim Elsey
Certified LabVIEW Architect
0 Kudos
Message 5 of 29
(4,968 Views)
you can use an xy graph and you can check the value of your y and plot your avaerage
Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
0 Kudos
Message 6 of 29
(4,961 Views)

Tim gave you a good response (much better than mine was going ot be so I'm just ommitting. Here is a way to find an average of array values once you have the array you want.

 

Message Edited by for(imstuck) on 11-11-2009 11:47 AM
0 Kudos
Message 7 of 29
(4,959 Views)

@for(imstuck) wrote:

 


 

mean.PNG
Message Edited by elset191 on 11-11-2009 11:50 AM
--
Tim Elsey
Certified LabVIEW Architect
0 Kudos
Message 8 of 29
(4,951 Views)

Thanks!

 

 

I'll be looking through all this and trying to see if I can forge it all together into a working program. I appreciate all the support!

 

 

0 Kudos
Message 9 of 29
(4,940 Views)

A few questions, within the span finder:

 

 


As you mentioned using left, span, and array to come up with values, can you elaborate as to what you mean by this? How do I use this to output to the mean function?

 

 

0 Kudos
Message 10 of 29
(4,919 Views)