07-08-2022 08:55 PM
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...
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
07-09-2022 04:43 PM
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.
(Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
07-09-2022 06:17 PM
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 );