Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Best practice for logging measurements (fastest logging)

Solved!
Go to solution

What is the fastest or best way to log data? I want to capture multiple signals with 100 samples / second. To be able to plot the various waveforms I want to log the measurements to file. But this means than 6 channels with 100 samples -> 600 samples per second.  What would be the best approach? I could for instance use the 'Write to delimited spreadsheet function'  in a seperate loop with a notifier for communication.So the measurement loop is not influenced.

 

Another option would be to use the ' write to measurement file ' on the data aquistion loop and write to excel (or tdms for instance).  But when taking 100 samples per iteration it puts the measurements after each other but the time is iterated in seconds. So my measurement time stamps then don't match. I would then stop the measurment at 11.40 but according to the timestamps I have data until 11.45...

 

screenshot.png

 

Download All
0 Kudos
Message 1 of 6
(4,773 Views)
Solution
Accepted by topic author LennartM

First: 600 samples a second isn't that fast 😄

Storing the data I would propose a binary format. I use tdms files and store in 30min to 1h branches.

Take a look at the DAQmx driver they already support logging 😉 

 

To display data: Use a producer consumer achitecture ...

The producer reads the data, the consumer(s) store and display the data, With seismic data (at similar speed) I even put some more live analyses (Spectra, spectrogram, .... 3D disdplay of data etc) without affecting the  read and logging.

 

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


Message 2 of 6
(4,755 Views)

My personal preference is to use the DAQmx Configure Logging to make DAQmx stream all of your data straight to a TDMS file.  You just use that VI before starting the task and it does everything for you.  You just have to read the data and display it however you want (typically with a chart).


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 6
(4,743 Views)

Thanks for the answers.
But there is no general best practice?

You could for instance also log the data to disk in the consumer loop.  Or are the tdms logging options in daqmx fast enough to be in the aquistion loop?

0 Kudos
Message 4 of 6
(4,661 Views)

@LennartM wrote:

You could for instance also log the data to disk in the consumer loop.  Or are the tdms logging options in daqmx fast enough to be in the aquistion loop?


The DAQmx Logging is faster than using a consumer loop.  That is your general best practice.  The reason is that the DAQmx driver avoids levels of software in order to get the data to disk.  It will always out perform a Producer/Consumer for logging of data.

 

And the DAQmx Configure Logging is done as part of the setup phase of the acquisition.  Once you use DAQmx Run, it is logging the data.  So it is not exactly part of the acquisition loop.


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
Message 5 of 6
(4,653 Views)

I thought we were going to be talking giga-samples per second.  In any case the easiest solution is the one already mentioned.  Use TDMS that is built into the DAQmx API.  There are several shipping examples in the Help >> Find Examples that work nicely.  

0 Kudos
Message 6 of 6
(4,647 Views)