10-12-2012 01:38 PM
I am using a PXI chassis (real time) to acquire data from various channels (7 differential analog channels). I am also using labview version 8.6. I would like to be able to write all of these channels to file at a very fast sample rate. If I try to write to file faster than 1 sample per second, it slows down the entire program. The chassis just can't keep up. Is there a way to write to a variable, and then write to file once the data acquisistion is done? Is there a way to write all of this data to file rather quickly? I would like to be able to acquire data at a sample rate of 1000 samples per second. Any help would be greatly appreciated.
10-12-2012 02:21 PM
How are you saving the data to disk?
I'm not sure if it is available in RT, but DAQmx (starting with version 9) has a Stream to TDMS function to automatically send your DAQ data to a TDMS file. This can help a lot.
10-12-2012 02:48 PM
I am using a write to spreadsheet vi. I am using a build array just before the write to file vi to gather 11 different signals to send to the write to file. I have tried inserting a copy of my code, but it isn't working for some reason. We typically just save the file as a text (.txt) file.
10-12-2012 03:58 PM
There could be a lot of issues going on here. Are you writing your spreadsheet values in the same loop as your DAQ? If so this is why you are slowing down yoru DAQ. Also, from what i understand writing a TDMS file is much faster than spreadsheet b/c its a binary format. I would recommend switching to TDMS. There is an addon for excel that allows you to import these files directly into excel. If you have to have a delimated spreadsheet file, you could write to TDMS and then write your spreadsheet after all your sampling is complete by reading the TDMS and converting the data into spreadsheet format.
10-12-2012 05:36 PM
@bobsmack wrote:
I am using a write to spreadsheet vi.
Well, this is definitely not a high performance option, because write to spreasheet file needs to do quite a few expensive operations for each call (1) open the file, (2) format the data in human readable form, (2) close the file).
You will be orders of magnitude faster if you open the file once before the loop and append raw binary data with each write, then close the file after the loop has finished. Try it!