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: 

Sending an average of X samples every one second from DAQ acqusition

Hey there Labview forums,

 

I am currently working on a project that involves working with three different DAQs, acquiring at three different speeds:

 

  • NI9211, which is acquiring 4 thermocouple inputs, 1 sample at 1Hz (since temperature varies slowly, and the DAQ can't work much faster, anyway).
  • NI9203, acquring current from a pressure transducer, 1k samples, 10kHz, owed to fast variations in pressure.
  • NI9423, acquring pulses from a hall effect sensor (and reading their frequency), ideally at the same conditions as above, but I can't say for sure whether it can do that as I don't have the actual device with me right now, and it's not able to be completely simulated with simulated DAQs.

The above three are connected to an NI-9184 chassis. I display the actual data real time using property nodes, so high speed acquisition for the latter two is very much preferable. Each of those has a SubVI responsible for a specific set of measurements.

 

Now, for the purpose of logging the acquired data, I will be using a template-based excel logging system, which works just fine in logging the data it acquires, however, since the data from the pressure and pulse DAQs is acquired so much faster than the temperature DAQ, for each one measurement of temperature, there are many more of pressure and frequency, which throws off my whole log in excel. My questions are:

 

  • How do I make an average of a large amount of samples (say, 100) which is being output from the SubVI at a rate of 1avg/second?
  • I have heard of queues being used for this purpose, but I am new to the whole topic, and I am not yet familiar with their usage. What Labview help pages or examples are relevant to learn this?
  • Any other ways to implement this?

If you'd like to see code, it can be of course included, but I felt my questions were more theoretical, and at this stage, it is a bit half baked and mostly uncommented so I didn't include it for now.

 

Thank you for your help.

0 Kudos
Message 1 of 3
(2,911 Views)

Bump.

0 Kudos
Message 2 of 3
(2,868 Views)

@xen20 wrote:
  • How do I make an average of a large amount of samples (say, 100) which is being output from the SubVI at a rate of 1avg/second?

The simple answer is with the Mean.vi.  You will need to loop on each channel and do a mean calculation for each channel, but that is a simple FOR loop.

 

But since you are getting 1kS from a 10kHz sample rate, then you are getting 100ms of data with each read.  You will need to append those samples to an array and then perform the mean every 10 reads.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 3
(2,862 Views)