Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

analog trigger delays 300ms in NI-DAQmx Base

I modified the multVoltUpdates.c example to output on a trigger. This works fine if the trigger is digital, but DAQmxBaseStartTask delays 300 ms on an analog trigger. Is there another way to use the analog trigger without the delay? Here is the code:

DAQmxErrChk (DAQmxBaseCreateTask("",&taskHandle));
DAQmxErrChk (DAQmxBaseCreateAOVoltageChan(taskHandle,chan,"",min,max,DAQmx_Val_Volts,NULL));
DAQmxErrChk (DAQmxBaseCfgSampClkTiming(taskHandle,"",sampleRate,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,samplesPerChan));
DAQmxErrChk (DAQmxBaseWriteAnalogF64(taskHandle,samplesPerChan,0,timeout,DAQmx_Val_GroupByChannel,data,&pointsWritten,NULL));
if (AnaDigiTrigSelect)
DAQmxErrChk (DAQmxBaseCfgAnlgEdgeStartTrig(taskHandle,triggerSourceAna,triggerSlope,triggerLevel));
if (!AnaDigiTrigSelect)
DAQmxErrChk (DAQmxBaseCfgDigEdgeStartTrig(taskHandle,triggerSourceDigi,DAQmx_Val_Rising));
done=0;
saveTime = currentTime();
DAQmxErrChk (DAQmxBaseStartTask(taskHandle));
printf("time in msec delay - %f\n",currentTime()-saveTime);

I'm using the PCI-6251 board with BNC-2090 and a G4 computer.
0 Kudos
Message 1 of 6
(3,530 Views)

Hi cresler,

 

Thank you for posting to the NI forums.  What value and slope direction are you using for the trigger?  There is a known issue with DAQmx Base and using a falling analog trigger level – sometimes the driver will ignore the trigger.  As a workaround, I would recommend either using a rising analog edge or keeping the digital start trigger.

 

I hope this helps.  Good luck with your application!

 

Ed W.

Applications Engineer

National Instruments

0 Kudos
Message 2 of 6
(3,514 Views)
Thanks for your reply! I am using a positive slope, and I tried several levels, with the same result. Please note that this delay of 300ms is not at the time of trigger, but at the DAQmxBaseStartTask call. The 24 digital lines are already busy emulating a NI PCI-6503 board. I need a triggered analog output at 4 times per second. Responding to your comment, about the falling analog trigger, a driver should not be ignoring a trigger, regardless! I suspect I've uncovered a bug with this delay. I hope I don't have to write a kernel extension!
C. Resler
0 Kudos
Message 3 of 6
(3,503 Views)

Hello C. Resler. 

As I understand you post currently, you are able to trigger off an analog edge, but you are concerned about the time it takes to execute the DAQmxBaseStartTask call.  You report that this is taking about 300 ms.  You also report that the digital trigger works just fine.  How long does the DAQmxBaseStartTask function take when you are using a digital trigger?  My thought is that there is more configuration necessary when configuring an analog trigger instead of a digital trigger and hence the longer delay. 

You also state that PCI-6503 is running at the same time the other functions are called.  If you shut down all other processes that your processor is currently executing and only focus on starting the DAQmxBaseTask, how long does it take?  It may simply be a limitation of your processor. 

Let me know how these tests go!  Have a great day!

Brian F
Applications Engineering
National Instruments

0 Kudos
Message 4 of 6
(3,487 Views)
Thanks for your reply, Brian. The DAQmxBaseStartTask function takes 0.5 msec for a digital trigger. The 300ms delay for configuring an analog trigger makes it useless, probably for most of us. I'm not now using a PCI-6503. My point is that the 24 digital lines will in the future not be available for the trigger. I have thought of another solution. In the adjacent vacant PCI slot I have installed a BNC connector on the metal tab that fills the hole for that slot. Now I only need to run a wire to the 34 pin RTSI connector on the PCI-6251 board. I'll use this for my trigger line. But I can't find the pinout for this connector. Can you help me out?
C. Resler
0 Kudos
Message 5 of 6
(3,476 Views)

Hello C. Resler.

After doing some additional research, I have found that this delay is expected behavior.  There is actually a wait specified in the DAQmxBaseStartTask of 250 ms when using an analog trigger to allow time for settling specific components on the hardware.  I would recommend instead gathering the analog data continuously and then doing some post-processing of the data which would only include the data that was above a certain level (equivalent to an analog trigger). 

As far as the pinout for the 34 pin RTSI connector on the 6251, please refer to the following knowledge base:

RTSI Connector Pinout
http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/ad2d553f55a07bbf8625650d005f1f00?O...

Let us know if you have any other questions and we will be happy to help you further!

Brian F
Applications Engineer
National Instruments

0 Kudos
Message 6 of 6
(3,469 Views)