From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

average N-sample acquisition

Hi

 

I would like to collect N-samples of data (for example 10) and average those values and then place the averaged value in a graph as well as dumped to a file.  What is the best way to do this that maintains a fast sampling rate?

 

Thanks!!

0 Kudos
Message 1 of 5
(5,138 Views)

1.  Acquire 10 samples.

2.  Pass data into a queue.  Have parallel while loop dequeue.  This is producer/consumer architecture.

3.  In consumer loop, dequeue and write to file.

 

What kind of sampling rate are you looking for?

0 Kudos
Message 2 of 5
(5,136 Views)
I would like 10 samples/second for a 15 channels.  Do you have any sample codes?  Thank you!!
0 Kudos
Message 3 of 5
(5,117 Views)

So write to a file at once/second then?  That isn't too bad.  I don't have any sample code.  But it is not that complicated.

 

What part are you stuck on?  It sounds like you may never have used LabVIEW before.  I would recommend you start here. How to Learn LV

0 Kudos
Message 4 of 5
(5,113 Views)

Here are a couple of links you may find useful.

 

The first is an example of how to acquire and write to a TDMS file using producer consumer

 

The second is an example on how to acquire, graph and average data

 

You can take parts from both examples and combine them to suit your requirements. 

 

Hope this helps!

Tejinder Gill
National Instruments
Applications Engineer
Visit ni.com/gettingstarted for step-by-step help in setting up your system.
0 Kudos
Message 5 of 5
(5,071 Views)