LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

average of the last 1000 values

Hello all,

 

   I am taking continous measurement and I wanted to average the last 10000 readings and stop the loop if the stanard deviation is less then 0.2. I couldnt configure how to delete the earlier data than the last 10000 measurements. 

 

Thanks

Message 1 of 6
(2,716 Views)

Look in the Signal Processing->Point by Point->Probability and Statistics PtbyPt palette.  There is a mean and a standard deviation in there.  It will do it all for you.


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
Message 2 of 6
(2,714 Views)

Thanks but I am avare of that VI. My question is more like how can I delete the previous values from the array so I will always have 10000 readings ? 

Message 3 of 6
(2,712 Views)

I'm afraid I may also be misinterpreting the question, but the image below shows 3 different methods for getting a select 10,000 datapoints from an array. If this doesn't help, please post your vi or a sample of the code in question.

 

subset.JPG

 

------

Matt Kirk

Inventor of ImageJVI

Message 4 of 6
(2,702 Views)

If you open the block diagrams of the VIs suggested by crossrulz, you can see how NI does it.  The PtByPt VIs accumulate the specified number of points and then operate as a circular buffer, discarding points which are no longer needed.

 

Lynn

Message 5 of 6
(2,701 Views)

Yes, looks like I have misunderstood the response. All were very helpful, I appreciate that and I am using PtByPt VIs.

Message 6 of 6
(2,665 Views)