07-09-2010 11:03 AM
Sorry if this is a simple question, but I have been porting a LabVIEW VI to C code using the DAQmx library. I cannot find a function in the documentation to read the number of samps available from a continuous acquisition. The LabVIEW VI uses the property node --> AvailSampsPerChan to read this.
Just to be clear, we have a continuous acquisition running, and the main program loop continuously checks the number of samples available. When it reaches a certain number, the buffer is read and the process repeats.
Thanks,
Alex
07-09-2010 07:25 PM
I believe I've figured out how to do this.
If you use DAQmxGetReadAttribute() to get the attribute DAQmx_Read_AvailSampPerChan, it will tell you the number of samples available to be read.
07-11-2010 09:58 PM
Sounds like DAQmxRegisterEveryNSamplesEvent() might help you. This function executes a callback function that you specify each time N samples have been read into the input buffer. The callback function (that you create) processes the data.
There is an example CVI program that illustrates the use this function. I'm not currently on a computer that has CVI installed or I would find the name of the example program for you.
07-12-2010 09:31 AM
Well I will try the readAttributes approach, the registerNSamples event does seem the obvious choice except that I am actually using this as an external library call in MATLAB so I'm not sure how to/if it's possible to use callback functions. Thanks!