11-21-2010 11:41 PM
Hi,
I have a problem. I'm reading data continuously from analog input. I want calculate average value when I press button START. Average value should be calculated from samples which are defined by 'Number of samples' and 'millisecond multiple'. When all samples are read, average vale should show.
The problem is that when number of samples is higher then 10, it doesn't work.
Can someone tell me what I did wrong?
Thanks
P.S.. I saw that there was something like this but I can't open it because I use Labview 8.5
11-22-2010 12:42 AM - edited 11-22-2010 12:42 AM
So you are reading 1000 samples at a time, throwing everything away unless you press "start", at which point you take the currently sampled 1000 points and average the first N data points, again throwing away all remaining data.
Why are you slowing down the inner FOR loop with a wait? That just delays the result and holds up the entire big while loop.
I must be missing something. Can you explain once more what you actually want to average?
11-22-2010 12:56 AM
The averaging is just a part of a bigger vi. The reason why I read 1000 samples is that I measure torque of engine with internal combustion and I need to do vi which would be able to average only part of collected samples.
These collected data are defined with number of samples and millisecond multiple.
Is it possible to do that in this way?
11-22-2010 02:21 AM
11-22-2010 03:29 AM
@P Anand wrote:
i have attached a VI regarding that
That VI makes no sense. Why would you use an event structure that stalls the entire loop until the button is pressed? You are building an array forever, but only look at the same first n point, no matter how many time we press the button and how much data we acquire.
Please don't post misleading/wrong examples. This is not helpful and only confuses.
11-22-2010 05:14 AM
Ya thats my mistake.. Very sorry for that... Forgot to wire the timeou.. i Just tried to convey that an Event case can be used....