Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Latency issues calling DAQmxStartTask and DAQmxStopTask

When calling DAQmxStopTask on my PC when all processes are idle it takes about ~25 ms for the stop task to finish.  If my CPU is busy working with another process this latency can jump to the hundreds!!!  of milliseconds.  Also when busy the DAQmxStartTask can also take "too long" to start up.  I have tried setting thread priorities but this doesn't seem to have any affect.  My application is very dynamic as the user can choose to collect or not collect any number of AI, DI, CTR channels from one run to the next.  Since our cycle times per part are sometimes very small the latency to stop and start a daq task is making the application unusable.  Leaving the task always running is NOT an option as I need maximum throughput and don't want to collect channels that are not required by the task.  Suggestions or comments please
 
Thanks
0 Kudos
Message 1 of 2
(3,257 Views)
Hi Lou_III,

One thing you can do is commit the task before you start and stop the task.  Basically you can use the DAQmxTaskControl to commit the task in your initialization section.  Then when you start the task, it should be faster than if you just used a start task.  Other than that, there is only one CPU so if something is taking up CPU resources, then it will take away from the DAQmx functions.  You can set the thread to a higher priority, but windows will still allow other threads to run.  It won't completely lock out other threads, otherwise you would not be able to use your mouse or keyboard.

Let me know if you have any questions.
Thank You,

Nick F.
Applications Engineer
0 Kudos
Message 2 of 2
(3,222 Views)