01-23-2013 03:31 PM
I have attached a very basic, very simlpe Labview 2011 vi that takes values from a force sensor. (Yes, I also know that the program name has force mispelled).
The program is recording at 100 hz and displays that value on a graph. I am also recording the value at that exact frequency as well.
I would like to be able to take "n" samples and average them together and display that value. For instance, while recording and displaying the graph at 100 hz, I would like to take 50 samples at a time and average them and display that value. This would mean my indicator would change 2 times a second instead of 100 times a second. I have tried buidling arrays and averaging values, shift registers in a for loop, etc. I tied mocking all the examples and just couldn't get it to come out right. It would average the values but would keep displaying at 100 hz. Any help on this???
The average value will basically be used for a quick eye shot calibration before I begin my tests. Any help is appreciated!
01-23-2013 03:48 PM - edited 01-23-2013 04:20 PM
Why don't you read N samples and simply take the mean of the array?
If you want to read only one sample per iteration as you currently do (why?), use Mean ptbypt.
01-24-2013 08:34 AM
I tried Mean, but when I hooked my indicator to it on this particular program the indicator still displays at 100hz, not what my mean sample length is. I would think it would display correctly, but I cannot get it to actually display the sample length average that I want.
01-24-2013 09:56 AM
That makes no sense. If you wire the mean to the output of the DAQmx Read, it will read the mean of all points you acquire and yes, you simply have to set the number of samples to 100.
What is the point of the 'co.' and 'sub' controls? The Index Array, For Loop, and Divide by 20 are just silly.
01-24-2013 10:47 AM
01-24-2013 10:54 AM - edited 01-24-2013 10:59 AM
Show us the new code.
Nobody can tell 100Hz by looking at the front panel. How did you measure it? Also connect an error indicator to the error wire after the readf operation, but inside the loop. Does it show anything interesting?