LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Averaging a waveform over a time interval

Hello all!

 

I am acquiring two continuous data signals, one from a NI-9211 and the other from a USB-6002.  The NI-9211 is set for 3 samples to read at a 3 Hz rate.  The USB-6002 is set for 1000 samples to read at a 1 kHz rate with a 0-5 V signal input.  The reason the USB-6002 is set for such a high rate is that the voltage signal has a lot of variability in the mV range.

 

What I want to do is take an average of the data points from each signal at 1 second intervals.  The averaged data is then being used to calculate a third value.

 

Then I want to do the same thing, but at 2 minute intervals.  The two minute interval data will be saved to an Excel file.

 

The reason I want both 1 second and 2 minute intervals is that I want to view the data in real-time.  However, since my testing is about 24 hours in length and I am not expecting large changes, I want to save averaged values every 2 minutes.

 

The problem I am having is averaging the waveform data from the signals.  Any help would be greatly appreciated.  Thanks!

0 Kudos
Message 1 of 6
(3,499 Views)
Both of your signals are 1 second results so you can just use the Mean function on each of the signals. Use an Express function if you are using the evil dynamic data. You have haven't posted any code to allow a more precise answer.
0 Kudos
Message 2 of 6
(3,494 Views)

Capture.PNG

Will be your friend

Capture.PNG


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 6
(3,487 Views)

Sorry, I forgot to attach the code.  See attached to this post.

0 Kudos
Message 4 of 6
(3,482 Views)

Thanks for the idea.  I tried implementing your design using a simulated DC signal but I only got one set of samples from the signal even though it was set on continuous.  See attached vi.

 

Would it be easier to average the 1000 data points I get every second and then average 120 second chunks of data?

0 Kudos
Message 5 of 6
(3,442 Views)

Hi CalebWG,

 

Try putting the DAQ-Assistant inside the while loop. You can discard the queue’s functions. Let me know if this is what you needed or if I misunderstood your requirements.

 

Luis C.

National Instruments

0 Kudos
Message 6 of 6
(3,386 Views)