I have a program that does standard DAQ, I am failry new to all this
but I do kind of understand how it works. My program does the data
Aqcuisition, does some processing and displays the data (V vs. T, f, d
vs. T) ect. I need to be able to write this data to a text file as
well as diplaying it in a graph. What I am not sure about is when to
write the data to disk. Let's say I am sampling at 40KHz and I am
taking 32768 points if I wanted to record the data for each point I
sample how would I do this?
The NI-DAQmx C Reference Help File is the best place to get specific information on these functions. It installs at Start >> Programs >> National Instruments >> NI-DAQ. Examples for using the functions are found at C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Analog In\Measure Voltage. I think you would be particularly interested in "Acq-Int Clk".
However, I suspect you may have already found this. The DAQmxReadAnalogF64 will return however many samples you specify in numSampsPerChan for each channel that exists in your task specified by taskHandle. If you have a task with 4 channels and set numSampsPerChan = 32768, then the data you get back will be 4 channels with 32768 samples each. Using a rate of 40KHz, you will acquire this data in just under a second. After it is acquired you could write the array to file.
I did finaly figure it out, unfortunatley writing it to a file takes to long for what I need, I am going to have to look at multithreading or some other way of saving this data, but thank you for your input.