04-25-2012 07:29 AM
Hello,
I have noticed a substantial difference in file size when using either on of these VI's to collect and write data in a TDMS format.
I have looked through the TDMS API and it appears that when I follow the process of opening, writing and closing a file I get similar file sizes as when using the Write to Measurement file VI.
In my example I am acquiring about 950 kb of data per minute using the DAQmx Configure Logging VI and about 3500 kb / minute when using either the Write to Measurement file VI.
I have verified that both files contain the same amount of data by viewing the amount of data using DIAdem.
Does anyone know why one file size is so much larger then the other even though they contain the same amount of usable data?
I would like to continue to use the DAQmx Configure Logging VI however I would like to determine if there is a way to decimate some of the data being recorded. I have 20 channels of data that I am recording and more then half of those channels are temperature channels which do not need to be recorded at such a high sample rate. Is there anyway I could record the several channels at 1000 Hz and the remaining at 1 Hz?
Furthermore I was also wondering if there us a way to add header information to the data file using the DAQmx Configure logging VI.
Any help would be appreciated.
04-25-2012 12:49 PM
There are two reasons why the files are smaller when using the DAQmx Configure Logging VI:
For the first item, you can do this yourself too with the regular TDMS API; it's just a lot more difficult to do it yourself. For the second item, look at the size of the index file that is next to the tdms file in both cases. For the index file that was generated with the TDMS API, check if that file is large relative to the main tdms file. If it is, there might be some inefficiencies that can be improved when writing to TDMS.
To answer your questions about decimating data, you have a few options:
The built-in TDMS logging in DAQmx is largely based around performance optimization. In a potential feature like decimated data, the work involved would actually be to look at every scaled sample in order to do a proper decimation. This performance degradation is a bit contrary to the feature's design, and therefore, is in some ways best left to the API user.
To answer your follow-up question, there is a way to add your own header information to the data file; however, that would be independent of the DAQmx API. That is, after the file is logged, you can open the file with the TDMS API and set whatever properties apply. There's actually an example that shows this caled TDMS Logging - Write Group Properties.
Let me know if you have further questions.