Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does DAQmxStartTask take so long?

Using VisualBasic 6.0 to communicate with a PXI6733 DAC board, I find that calling DAQmxStartTask takes about 30 ms, which is too long for my application.  No error message is returned.  Before calling DAQmxStartTask, DAQmxWriteAnalogF64 is called, with AutoStart set to False.  Setting AutoStart to True eliminates the need for DAQmxStartTask, but  makes DAQmxWriteAnalogF64 take 30 ms, which is too long for my application.  Is it possible to shorten the time required for DAQmxStartTask?
0 Kudos
Message 1 of 6
(3,510 Views)
The time it takes to start a task in DAQmx is entirely dependent on your processor speed and the system resources available.  You may look in to using hardware triggering to being your analog generation, as you will get a significantly greater reaction time using hardware triggering instead of starting the task in software.
Seth B.
Principal Test Engineer | National Instruments
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 2 of 6
(3,486 Views)
You should also only be starting the task once - right when your program starts. The task would then be cleared when your program finishes.
0 Kudos
Message 3 of 6
(3,483 Views)
LabVIEW has the DAQmx Control Task.vi which when used with its Action = Commit will setup most of the parameters but not actually start the task until Start is called.  Maybe you can do something similar ?
0 Kudos
Message 4 of 6
(3,465 Views)
Thanks for the suggestions.   For my application, I need to run many different sets of timed DAC outputs.  So for each set of timed DAC outputs, I write the data to the board, then call DAQmxStartTask, and finally call DAQmxStopTask.  Yesterday I found that DAQmxStopTask was returning an error, because I was stopping the task before it completed.  If I get rid of this error by calling DAQmxStopTask only after the DAC board completes all the timed outputs in the set, then the next DAQmxStartTask is fast (less than a ms).  
0 Kudos
Message 5 of 6
(3,456 Views)
The DAQmxWaitUntilTaskDone function is likely what you will need.  You can get more information on this function in the NI-DAQmx C Reference Help.  TO access this help, select Start » All Programs » National Instruments » NI-DAQ » NI-DAQmx C Reference Help
Seth B.
Principal Test Engineer | National Instruments
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 6 of 6
(3,429 Views)