01-30-2012 11:09 AM
Hi all,
I do not understand how Aritmetic Mean of Stattistics Express vi does work. How many samples does it use to calculate the mean during a continuous acquisition? I assume it is not possible to change this value but it would be useful to know it.
Thank you very much.
Sangiox
01-30-2012 12:17 PM - edited 01-30-2012 12:17 PM
The Statistics Express VI is just a pretty front end to calling standard LabVIEW VIs or performing basic functions. In this case it's calling the standard Mean VI.
01-30-2012 01:46 PM
Thanks for your reply but the question remains? How many sampled does it use to calculate the mean?
Thank you.
Sangiox
01-30-2012 03:22 PM
Did you look at the documentation for the Mean VI? It just takes the mean of all the values. How else would you define mean?
01-31-2012 02:01 AM
Ok, I try to explain better what I mean.
I have a DAQmx continuous acquisition with a scan rate of 100 kS/s that means every second I have 100k sample. This acquisition is inside a whille loop as usual as well as my arithmetic mean. I assume that during a second I have many loops and in each loop my acquisition get a number of samples on which it can calculate the arithmetic mean.
So my question: how many samples LV get inside a while loop with this configuration?
In this way I can know how many sample it uses for calculate the arithmetic mean.
I hope it's more clear now.
Thank you again,
Sangioz
01-31-2012 07:38 AM
You will have as many samples as you programmed the DAQmx function to return, regardless of scan rate. If that does not answer your question, then please upload your code.
01-31-2012 01:32 PM
If I well understand, if you acquire "N samples" at a specific Scan Rate LV gives you that N samples. If you choose "Continuous Acquisition", it is possible to specify the Scar Rate but it will run continuosly untill you stop it.
Inside a while loop, at each loop you can not decide how many samples you have ready for data manipulation. Am I wrong? Can you set it?
02-01-2012 02:00 AM
Dont choose Continous Acquisition and you'll have N samples for data manipulation ...
/Y
02-01-2012 02:09 AM
Brilliant idea, but I need to use "Continuous acquisition"...
02-01-2012 03:08 PM
Of course you can set the number of samples to read. That is what the 'number of samples per channel' input is for. Even if you leave it at the default of -1 (return all available samples), what is returned is an array (1D, 2D, etc.) and you can simply use the Array Size function.