11-03-2016 05:50 AM - edited 11-03-2016 05:52 AM
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...
Solved! Go to Solution.
11-03-2016 08:26 AM
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.
11-03-2016 11:12 AM
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).
11-11-2016 07:20 AM
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?
11-11-2016 09:27 AM
@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.
11-11-2016 11:02 AM
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord