01-20-2009 01:00 PM
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
Solved! Go to Solution.
01-21-2009 12:11 PM
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
01-21-2009 03:16 PM
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
06-10-2011 07:47 AM
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
06-10-2011 07:50 AM
I'm using Matlab btw, so any translation from labview to Matlab would be much appreciated!
Nathan
06-10-2011 10:13 AM - edited 06-10-2011 10:14 AM
<removed due to inadvertant double post...>
06-10-2011 10:13 AM
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