11-19-2012 01:43 PM
Hi Guys--
My question concerns a cDAQ-9178 with an AI and AO module (9215 and 9263, resp.). For testing purposes, I have connected ao0 directly to ai0. My goal is to have the reads and writes synchronized, but with the reads occuring slightly after the writes. I had hoped to accomplish this by having the the AO write on the rising clock edge, and the AI read on the falling clock edge. This isn't working, so obviously there is something more I need to learn about the system. Here's what I have:
I've borrowed heavily from some of the DAQmx examples here. Obviously, I'm making some bad assumptions about the inner workings of the timing functionality. Anyone want to point me in the right direction here?
As a post-script, if the above simply will not work, I'd settle for simply having the AI routine kick in one sample after the AO routine starts. Is that a better solution, and if so, is there an example of such a scheme out there somewhere?
Thanks in advance for the help. Be well, and have a great day.
--Brad
Solved! Go to Solution.
11-19-2012 02:05 PM
@bcro wrote:
As a post-script, if the above simply will not work, I'd settle for simply having the AI routine kick in one sample after the AO routine starts. Is that a better solution, and if so, is there an example of such a scheme out there somewhere?
It looks like your AI is already 1 cycle behind the AO. Which is exactly what I would expect. It does take time to set an output and then to read it. Half the cycle just might not be enough.
11-19-2012 03:32 PM
Brad,
The trigger signal exported from your AO task is very narrow (likely on the order of 10s of nanoseconds). I suspect that this is not going to offset your AI reading nearly as much as you'd like. Instead, I would suggest that you use two properties from the DAQmx Trigger Property node to do this for you. These properties can be found from 'DAQmx Trigger Property Node->Start->More->Delay' and 'DAQmx Trigger Property Node->Start->More->Delay Units'. Place this property node on your AI task, right after you call the DAQmx Trigger VI. Using these two properties, you can hold off the start of your AI sample clock according to the values set on these properties.
Hope that helps,
Dan
11-20-2012 09:40 AM
Ahhhh...in reading you guys' replies, I realized I had it in mind that I was dealing with a clock signal with a 50% duty cycle. Hence my confusion when I saw the same behavior even at slower frequencies like 1000 Samps/sec.
Anyhow, the trigger delay functions were exactly what I need (thanks Dan). After some experiments, I've that a delay ~ 8 microSecs is about right when running at the full 100kS/s my hardware allows.
Thanks a bunch for you guys time. Be well, and have a great holiday.
--Brad