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.
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.
03-20-2012 07:09 PM
Hello All,
I have this simple program to acquire a voltage and write it to a file.
I am thankfull for any suggestions that makes acquire and write data to the file as fast as possible.
One channel input 0 - 10volts on Multifunction DAQ
I am using LabVIEW 2009.
thanks
03-20-2012 10:25 PM
You are collecting 50 samples at a time on a 10kHz. clock. That means your loop will have to run as fast as 5 msec per iteration to keep up. That is pretty quick. I don't even know if the file writing can occur that quickly.
You need a producer/consumer architecture so that one loop gets the DAQ data and passes it to the consumer loop via a queue for writing out to a file. That way delays in file writing don't slow down your data acquisition.
I would also collect more than 50 samples at a time. Try 1000-5000 samples at a time. When you send that data to the file writing loop, the file writing will be far more efficient writing out a larger dataset than a small number of bytes.
03-20-2012 10:28 PM - edited 03-20-2012 10:29 PM
I would suggest you to use queue to write the data to a file as shown below. This gives an option for extending your current code and provide loss less and high speed data acquisition.
Good luck
03-21-2012 02:49 AM
I have had a luck with file handling performance by using TDMS files. I believe its buffered but I am sure an expert on here can go into much more detail
03-21-2012 07:16 AM
Its a tensile strength experiment the more data the better.
I am trying to seperate the data collection from the logging process, fully aware the opening and closing a file will tax the speed. I tried the producer architecture but i got hang up somewhere as such i wanted to go back to basics.
I tried the 50 samples at 10kHz just to see the limits but agree at runtime i will use 1000 samples. thanks
03-21-2012 07:22 AM
the way im doing it, is to initialise my file handling including open the tdms file, set up read data and get that started in the producer section. In the consumer section i write it straight to the tdms file (To be processed properly later). When test is finished i close the tdms file. There are a number of good articles about producer/consumer architecture and i would suggest you try to use this method
hope it helps
03-21-2012 07:25 AM
Try posting the code that you have tried.
03-21-2012 09:12 AM
Here was one of the attempts it is similar to P Anand.