09-20-2005 07:16 PM
09-21-2005 04:02 PM
09-21-2005 04:46 PM
09-22-2005 11:38 AM
09-22-2005 12:58 PM
09-22-2005 08:16 PM
09-23-2005 04:38 PM
Hi Ryan-
By calling the DAQmx Read in a loop and either varying the timeout or the number of samples to read you can read from the DAQ buffer in small chunks and also perform UI updates, look for user input, etc. These calls would also take place within the loop.
If this method is not satisfactory then you might be able to run the two processes in seperate threads. One thread would call the DAQmx read in a loop and pass data to another thread for use in graphing, etc. The NI-DAQmx API is completely multi-thread safe, so you can make NI-DAQmx calls in both threads if necessary.
Hopefully this helps-
09-28-2005 02:28 PM
Hey Tom,
Okay I made this into a multithreaded dialog app which runs the DAQ loop in a worker thread and leaves the User Interface thread unblocked for data display or user input.
So far in DAQmx I have only done DAQ's where I specified a finite number of data points to get ahead of time.
In the case that I don't know how many samples that the user wants to take, (just sample data until the user says stop), should I be using a circular buffer type loop for my DAQ loop?
Also, as data comes in I want to continuously and temporarily store it to a file (contiunous file concatenation?) in the case that the user wants to save the data that they captured. Is there a good sample code that illustrates this or am I on my own?
There was a double-buffered DAQ example in the traditional NIDAQ sample code, but I don't see one for DAQmx?
Thanks, Ryan
09-29-2005 02:01 PM