Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

PXI-6259 - Syncronize AO and DO

Solved!
Go to solution

Good afternoon friends,

 

I am looking to syncronize a finite analog output signal with a finite ditigal output signal of the same duration(# of samples).   Ideally, the signals would be identical except for amplitude... 5V for the TTL.   I'm assuming this will require a shared start trigger?   Does anyone have an example or know where I can find an example of syncronized finite AO and DO?   My hardware is a PXI-6259.

 

Thanks,

Zach

0 Kudos
Message 1 of 7
(4,235 Views)
Solution
Accepted by topic author super-neuron

Hello Super!

 

Thanks for your post! One of the ways that I would synchronize your AO and DO is to use the AO timing engine as your sample clock for both. This way you know that you are using the same sample clock that is generated on board the 6259. You just have to make sure to start your DO task before your AO so that when when the AO starts and generates the sample clock the DO task will see the first rising edge. Essentially you will be triggering the DO with the AO task. Take a look at the screen shot of the block diagram I made that does exactly this. I checked it with another DAQ board to ensure synchronization. Let us know if this helps and and take a look at this developer zone that talks about multifunction sync.

 

M Series Synchronization with LabVIEW and NI-DAQmx

 

Have a great day Super and let us know if this helps with your applications!

 

Cheers!

 

Corby_B

http://www.ni.com/support 

Message 2 of 7
(4,216 Views)

Corby,

 

Dude... the block diagram you sent is awesome!   Just got done checking the ouput on the oscilloscope.   15mins in Labview and it works perfectly!

 

Way to rock the DAQ forum!

 

Thank-You!

Zach

 

Message 3 of 7
(4,202 Views)

I have a DAQ X series USB_6353, 

 

I need to control a stepper motor driver with 5 V pulses on the AO to signal the steps and a 0 or 5 V signal on the DO to signal direction.  These two signals need to be very well synchronized, so that the direction switches inbetween the correct pulses.  I believe the pulses  need to be about 100kHz.

 

Would this suggestion for the PXI-6259 work for my system as well?

 

Best,

 

Nathan

0 Kudos
Message 4 of 7
(3,511 Views)

I'm using Matlab btw, so any translation from labview to Matlab would be much appreciated!

 

Nathan

0 Kudos
Message 5 of 7
(3,510 Views)

<removed due to inadvertant double post...>

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 6 of 7
(3,499 Views)

I wouldn't use AO for generating 5V step signals if you can use a digital logic 5V signal instead.  With an X-series board, you've got (at least) 2 alternative options:

 

1. Create a buffer of correlated digital states for both pulse and direction bits, and generate both in the same DO task.  Then they have to be sync'ed.  The downside is that to pulse at 100 kHz, you probably need timing precision of those pulses at something approach 1+ MHz.  That makes a pretty big buffer for long motion durations.  Note to other readers: this approach could also be done with an M-series board like the 6259 mentioned earlier in the thread.

 

2. Determine your sequence of step frequencies and create a buffered counter pulsetrain generation task.  Now

your buffer only needs to contain data for the times when pulses happen rather than the much greater amount of

data to define pulses in terms of digital states.  For 100 kHz, it's still not a *small* buffer, but it will be

considerably smaller than the DO option.

   To correlate the direction bit, here's how I'd do it:  Create a DO task for the direction bit.  Use the counter

output as the DO task's sample clock so that one direction bit state gets generated per pulse.  Be sure to

start the DO task before starting the counter task.  Also be sure to configure your counter pulses such that

the *leading* edge of the pulse creates the direction bit sample while the *trailing* edge activates the stepper

driver.  [So, if the driver is looking for rising edges, your counter task should have a high idle state where pulses

go low first then return high.  Your DO task should be clocked on the falling edge so the direction bit state is

valid at the time of the rising edge step pulse.]

  There are other ways to sync, but this is what I'd try first.

 

-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 7 of 7
(3,498 Views)