Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

nidaqmx logging data

Hi, I am trying to get started with nidaqmx 8.0.2 on Linux, using ansi c, and am a bit lost as to how I can log data to files. I've been looking at examples (e.g. in examples/ansi_c/AnalogIn/MeasureVoltage), but none seem to include what I need. Other posts have included references to TDMS examples in these directories, but those are missing for me.

 

Any advice on where to start would be most helpful!

 

-Melanie

0 Kudos
Message 1 of 3
(3,044 Views)

I set up an asychronous callback function to read continuous data.  At 1Hz (your application requirements may vary), I write the data to a file.

 

So the example for analog input that refers to continuous voltage: Cont Acq-Int Clk

 

I have an array for all of the channels I'm reading, and I read 100 S at 1000 S/s.  I then average the 100 S to get one data point.  Though I get data at 10Hz, I only write it at 1Hz.

 

Good luck!

 

P.S. The examples don't write the data to a file.  You will need to use the ANSI C stdio library for fopen and fputs, etc..

Programming Data Acquisition and Control in Measurement Studio and Labwindows/CVI
0 Kudos
Message 2 of 3
(3,036 Views)

Thanks for the reply! I think your p.s. gets to the heart of my problem - the examples provided don't write the data to file, and that's what I don't know how to do. I'm reasonably new to C/C++, so when you say "...use the stdio library" that makes sense, but I'm still lost at sea as to *how*.

 

If you've modified the ContAcq-IntClk example to write to file, any chance you could post the relevant code to give me an example to chew on?

 

Thanks!

0 Kudos
Message 3 of 3
(3,023 Views)