Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

AO on Rising, AI on Falling Edge, Synchronized

Solved!
Go to solution

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:AO on Rising, AI on Falling Edge, Synchronized.png

Front Panel.png

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

0 Kudos
Message 1 of 4
(3,219 Views)

@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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 4
(3,216 Views)
Solution
Accepted by topic author BradNC

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

Message 3 of 4
(3,211 Views)

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

0 Kudos
Message 4 of 4
(3,194 Views)