LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

averaging a DC waveforms with software

Hello,

 

I am new to labview forum and have been digging through old posts for about a week and have a question on averaging a DC signal based on a external trigger. I working on a homemade instrument in the lab. An Ion Mobility Drift Tube with laser ablation. The trigger for the acquisition is the q-switch from the laser operating at 2Hz. I have found the perfect example, that acquires the signal in real time based on the trigger out from the laser. The example was found in the NI examples (Acq&Graph Voltage-Int Clk-HW Trig Restarts.VI). The averaging function for DC-RMS does not seem to work out very well for me or I am not correctly using this function. The other way I tried is with add and divide nodes by creating an array from an example I saw in another post on the forum. The problem I need help solving is a way to average the DC signal with the software based on averaging anywhere from 10-60 waveforms similar to that of an oscilloscope. The sampling rate can vary but I usually set to about every 10us. I'am using LV 8.0 and a PCIe-6251 DAQ-mx. Thanks for your time and any help you offer.  

 

Stephen   

 

 

0 Kudos
Message 1 of 4
(2,567 Views)

Hi sd64,

 

If you're trying to get an average a series of waveforms, they need to be each in a different element of an array and after that the whole array is passed into Average DC/RMS. Right now you're only passing in one waveform at a time (after each read).

Jeff | LabVIEW Software Engineer
0 Kudos
Message 2 of 4
(2,525 Views)

Jeff,

 

Thanks for the help, but I do not know how to write the waveform to different elements of an array. Still learning Labview as I go building this VI. Is there an example you can point me to or some literature I can read up on so I can build the array for averaging. How does Labview store the waveforms in the array for averaging?  

0 Kudos
Message 3 of 4
(2,510 Views)

Basically, the changes I made were to Read with the 1 Chan N Samples (since it looks like you're only reading one channel), then using Build Array and a Shift Register, I keep adding elements to the array that are each one reading of the waveform. I now pass that whole array into the averaging VI.

 

Averaging.png

 

Note that is good practice generally to initialize your array to the maximum expected size (or at least wipe the array by initializing the shift register) with every iteration. In this case, initializing to a certain size would probably give some erroneous averaging.

Jeff | LabVIEW Software Engineer
0 Kudos
Message 4 of 4
(2,459 Views)