Hi bali,
What driver and version are you using to program your card?
If you're using the Traditional NI-DAQ driver, then you may be experiencing the single-threaded nature of the driver [1]. Only one call can be made to the driver at any time, so if the driver is asking the board for analog samples, you cannot read from the counter until the analog input read is finished. If this is the case, then the two different operations are trading time with the driver and there isn't much more you can do.
If you're using the new DAQmx driver, you may be not making calls to it correctly. For an example of making parallel calls to the driver, take a look at the shipping example called
"Multi-Function-Synch AI-Read Dig Chan.vi" [2].
Finally, if your program also does a lot of data post-processing or screen updates, then those other operations may be using processor time and delaying the counter read. You can use queues [3] or pipelining [4] to improve that performance.
[1] Why Do Parallel Loops with AI Read in My LabVIEW Program Seem to Wait?http://digital.ni.com/public.nsf/allkb/118EB2ABA2DBBAD186257356005C4A30?OpenDocument[2] Multi-Function-Synch AI-Read Dig Chan.viChoose
'Find Examples...' from the
LabVIEW Help menu, and navigate to
Hardware Input and Output » DAQmx » Synchronization » Multi-Function[3] Optimizing Automated Test Applications for Multicore Processors with NI LabVIEWhttp://zone.ni.com/devzone/cda/tut/p/id/5899[4] Programming Strategies for Multicore Processing: Pipelininghttp://zone.ni.com/devzone/cda/tut/p/id/6425
Joe Friedchicken| NI Configuration Based Software |
|---|
Get with your fellow OS users [ Linux ] [ macOS ] | Principal Software Engineer :: Configuration Based Software Senior Software Engineer :: Multifunction Instruments Applications Group (until May 2018) Software Engineer :: Measurements RLP Group (until Mar 2014) Applications Engineer :: High Speed Product Group (until Sep 2008) |