I have LV 8.6 basic.
I am aquiring a continuous analog voltage signal from an RPM transducer using a DAQ Asistant.
the display jumps around quite a bit and it could use some smoothing out. My thought is to average the data in sample groups.
The data type is dynamic coming from the assistant. I would like to try and average 10 to 20 samples them update the display so appears more stable.
I did search and look at many examples but I still stumped.
Solved! Go to Solution.
Thanks for the vi. I am new to programing so I'm still confused. I just want to output the mean value of a set number of voltage data points to a display set after set after set. This is much like the Average express .vi does in the profesional version of LV. Any thoughts?
Thanks in advance.
Please see the basic averaging code screenshot I have attached. Where the DAQ assistant is located would be where your dynamic data goes in.
I built a .vi based on the picture you sent but it looks like 0 is added to the aquired data value and then devided by 1???
I would like to out put to a display the mean of every 10 data points aquired. I must be missing something??
The symbol that the 0 constant is wired to is a Shift Register. This initialises the first run of the loop to have 0 in the shift register. On successive runs, the value going into the adder is the previous adder result which is wired to the right side Shift Register, this is a method of feedback to the next iteration of a loop.
I put a loop around your vi but it always passes 0 into the shift register and devides by 1 every time it loops ??? What do I have wrong?
Try my code, which is attached!
Notes: Replace the DAQ Assistant with your own, set to read a voltage on a channel of your choosing, with a finite (N Samples) number of samples (this is why I don't have a timer in my loop).
Make sure the samples to read is greater than 1, more like 1000 otherwise you won't have a valid average.
This seems to work.
So when the Daq assistant is set to "N samples" it takes that amount of samples and outputs them to the average code which updates the display each time the loop runs?
Do I have this correct??
I have a vi that has multiple loops. I want to stop them all with one front panel button but I need to complete the "shut down code in the last block of a flat sequence structure before exiting.Here is what I have.
thanks in advance!!
"So when the Daq assistant is set to "N samples" it takes that amount of samples and outputs them to the average code which updates the display each time the loop runs?"
As for your other question, try removing this from your sequence:
This is stopping your whole VI before the last frame of the sequence has a chance to execute. Your stop button will stop the while loop and let the next frame of the sequence execute.