01-05-2012 02:34 PM
Hi,
We are from Oklahoma State University, working on a Data Acquisition Project.
We are trying to do Data Acquisition through the NI 9234. We are using a C code related to the DAQ-mx driver, instead of the LabVIEW.
We want to save the acquired data to a file & print it by this program. However, as of now we are not able to do it. I am attaching the Program & the screen-shot of the current output that we are getting from the program.
It would be great if anyone can show how to log the acquired data into a file for further use.
Thanks,
Sauvik Das Gupta
01-06-2012 12:11 PM
One way to do it is with TDMS logging. DAQmx comes with functions designed to log to a TDMS file. This is a special file type that is used for collecting data in a logical format. It can be displayed in a TDMS viewer where data is separated into groups and channels. NI-DAQmx provides examples for how to log to TDMS. Look at the TDMS examples in the C:\Users\Public\Documents\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Analog In\Measure Voltage directory.
01-06-2012 02:25 PM
Hi,
I looked into the TDMS File Examples. I have worked on TDMS files before, & I know how they work.
I also wanted to know instead of saving the data acquired into a file & then post-process it, is there a way we can stream the data being acquired in real-time to a PC & work on the data in real-time?
We want to avoid the offline processing involving a file in between & do a real-time online processing instead.
Thanks,
Sauvik das Gupta
01-19-2012 07:02 PM
Hi,
I wanted to save data acquired from NI-DAQ (for example, NI 9234) in a file using the DAQ-mx ANSI C Code. The response I got was as follows:-
One way to do it is with TDMS logging. DAQmx comes with functions designed to log to a TDMS file. This is a special file type that is used for collecting data in a logical format. It can be displayed in a TDMS viewer where data is separated into groups and channels. NI-DAQmx provides examples for how to log to TDMS. Look at the TDMS examples in the C:\Users\Public\Documents\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Analog In\Measure Voltage directory.
However, now I want to know is there a way that using that same C code, can we save the data in a .txt file format (Text File) instead of a TDMS file? We actually want to access that file through MATLAB (that's why we want to save it in text format).
Also on an other note, is there a way we can access & open TDMS files by MATLAB?
Thanks,
Sauvik Das Gupta
01-20-2012 07:30 PM
Hi Sauvik,
Using the TDMS file save capabilities of the DAQmx drivers is a useful feature because it enables well-performing file saves during data acquisition.
The simplest option that involves no modification of your c-code would be to use the TDM Excel Add-In for Microsoft Excel to change file formats. Once the data is loaded into Excel it can be saved into a tab-delimited text file or comma separated values (csv) file capable of being imported into other programs.