Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmxCreateCOPulseChanTime takes too long to complete

I am using a NI 6229 multifunction card in an instrument and I am experiencing failures while trying to upgrade to newer versions of NIDaqMX.  I developed the code in c++ with NIDaqMX version 8.0, and find that in version 9.3.0 that my digital pulse task is taking much longer than it should, which casues my application to time out.  The code is used to generate a hardware timed pulse to control a shutter on one of the PFI lines (szExPort).  The task is gated to start after the signal on another PFI (szCamInternalTrPort) goes from low to high.

 

I have been using the following code successfully with NIDaqMX 8.0:

 

double dExTime = 2.0; // exosure time may vary from .0001 to 1000 seconds

NI_DAQmxCreateCOPulseChanTime(thCtr0, szC0, "", DAQmx_Val_Seconds, DAQmx_Val_Low,0.05, dExTime, 0.01);

DAQmxExportSignal (thCtr0, DAQmx_Val_CounterOutputEvent, szExPort);

DAQmxCfgDigEdgeStartTrig(thCtr0, szCamInternalTrPort, DAQmx_Val_Rising);

DAQmxStartTask(thCtr0);

 

after starting the task, I monitor it at intervals to see when it completes, using the function:

            BOOL bCtr0Done = (DAQmxWaitUntilTaskDone(thCtr0,0) == 0);

 

The problem is that newer versions of NIDaqMX (I tested with 9.3.0 and 8.7.0) does not return a done signal until approximately double the expected length.  My calculations show the task should take 2.060 seconds (.05 delay + 2.00 high + .01 low).  Indeed, in NIDaqMX version 8.0, this is the case.  but in the new versions this task takes about 3.98 second to complete.  Since I have a timeout period of CalculateLength + 2.0s, I start getting errors when a exposure time greater than about 2 seconds is specified.

 

I need to upgrade the DaqMX to 9.x, because we have another application that needs dot.net 4.0.  The problem is that the digital pulse task is taking way too long.  It is unreasonable to expect that I can just double expected task length.  How can I do this in version 9.x without excessive delays?

 

 

0 Kudos
Message 1 of 2
(2,933 Views)

Hi cgc,

 

Thank you for including all the necessary information in your post. I'm able to reproduce this problem on DAQmx 9.3.5, and I reported it as CAR #314091 for further investigation.

 

Brad

---
Brad Keryan
NI R&D
0 Kudos
Message 2 of 2
(2,922 Views)