08-04-2014 12:35 PM
Hello!
I'm looking for a recommendation on how to speed up a counter pulse generation.
Currently I am generating a clock tick using a counter, and routing this counter through the PXI back plane and into several multifunction DAQ cards to acquire one sample of data (multi channel from all the DAQ cards) for each loop iteration.
There are several reasons I do this:
The only way (currently) I can fire this counter pulse is by Starting and Stopping the task each iteration. Even the shipping examples do it this way. Using Execution Trace Toolkit, it's clear that the Counter Start Task takes 168 uSec, and the Counter Stop Task takes 100 uSec. The total of 268 uSec is a lot of time, and limits the ultimate loop rate I can run. My Single Point Read (only) takes 226 uSec (and runs in parallel multi-thread which is great). So the pulse generation consumes a lot of time relative to my desired loop rate.
I've been doing it this way for some time, but I would like to speed up the pulse generation somehow. Starting/stopping the counter task with each iteration seems inefficient. But alas I'm no expert on counters. If needed I can attach any VIs.
Thanks for any help!
Patrick
08-05-2014 01:35 PM
Hello,
For speeding up your program you should implement the DAQmx Control Task VI into your program. What the VI does is when you stop the program the driver state does not revert back to the original setting, but a hardware reset setting. As you found the Start and Stop Task VIs take a certain amount of time based on system configuration, and the hopefully the DAQmx Control Task VI will allow you to reduce this time. I have attached additional links below that give you more information on what the VI does and how it is used.
http://zone.ni.com/reference/en-XX/help/370466V-01/mxcncpts/taskstatemodel/ - the different stages
http://zone.ni.com/reference/en-XX/help/370469AA-01/lvdaqmx/mxtaskctrl/ - how to set the VI up
http://digital.ni.com/public.nsf/allkb/3D9CF4F4A0549F40862574420029ECCD - an example
08-05-2014 04:36 PM
Thanks for the quick reply!
Wow! That knocked the Start/Stop time down to 44/17 uSec, a huge improvement! I had not see that one before, so I'll have to experiment with it more in my other applications.
Thanks so much!
Patrick