From 01:00 AM CDT Saturday, June 10 - 04:00 AM CDT Saturday, June 10, will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Multifunction DAQ

Showing results for 
Search instead for 
Did you mean: 

Triggering AO with ai/StartTrigger and with certain delay



I have a USB 6366 simultaneous DAQ and want to use ai start trigger to trigger AO as well, but with certain delay time. Basically I want AI task to start first and then start AO task 10ms later.


I used below code to use AI start trigger for AO:

DAQmxErrChk (GetTerminalNameWithDevPrefix(AItaskHandle,"ai/StartTrigger",trigName));   // function to get AI trigger name
DAQmxErrChk (DAQmxCfgDigEdgeStartTrig(AOtaskHandle,trigName,DAQmx_Val_Rising)); // Set AO start trigger as AI start trigger 


And below code will start both AI and AO tasks at the same time, but want AO start 10ms later...

DAQmxErrChk (DAQmxStartTask(AOtaskHandle));



Can I change the duration of AI start trigger so I can use its falling edge to trigger AO? If so, how should I do?

DAQmxErrChk (DAQmxCfgDigEdgeStartTrig(AOtaskHandle,trigName,DAQmx_Val_Falling)); // Set AO start trigger as AI start trigger 


0 Kudos
Message 1 of 3

I don't know the text language syntax, but in LabVIEW there's a "trigger property node" that let's me set "trigger delay"=0.010 and "delay units"=seconds.  It ran without error for me on a simulated lower-end X-series device, so I expect it should be supported for your higher-end real device.  But again, I don't know the text language syntax needed to configure it that way.   It's probably available from any of the C variants and probably Python, but based on prior conversations I'd be less confident about Matlab support.



-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW?

(Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).

0 Kudos
Message 2 of 3

Thanks for the tip. I found similar old post for such problem and used its suggestion below. It seems working.


DAQmxSetStartTrigDelayUnits(AOtaskHandle , DAQmx_Val_Seconds);
DAQmxSetStartTrigDelay(AOtaskHandle, .00000002

0 Kudos
Message 3 of 3