The shipping example "ContAcq-IntClk-EveryNSamplesEvent.c" is a great event-based way of acquiring data only when it is ready, allowing your processor to do other tasks while your hardware is collecting samples. Unfortunately, this example does not give very much flexibility with the number of samples being acquired, the rate at which they are being acquired, and any information about how often samples are being pulled from the buffer. It can be very frustrating if errors are experienced after a long time of running the example, and information like times between callbacks, number of samples remaining in the buffer, and others would be very useful to track in order to fix such problems. The attached “Monitor Callback Times.c” is a modified version of this example, and it shows the number of samples on the buffer waiting to be read (as well as other information), as well as some other information using a printf() statement.

The example also tracks the time delay between successive callbacks in an array, and writes the array to a tab-delimited text file after the user is finished running the program. The text file is named “times.txt”, and will reside in the same directory as the application.
The entire example is written using DAQmx and ANSI C function calls.
For more text-based DAQmx examples, see the Developer Zone titled Text Based NI-DAQmx Data Acquisition Examples
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.