Discussion:
synchronizing two USB-6251 boards
(too old to reply)
DAQ question
2008-07-29 17:40:10 UTC
Permalink
I am attempting to synchronize two USB-6251 boards on one computer.  I use Matlab DAQ (not LabView).  I should be able to set the clocksource on one board to "externalclocksource" or "externalsamplectrl" and hook up the PFI2 from one to the other board and use that as the clock for both boards.  For some reason, I'm not getting any signal out of the PFI2 channel and the synchronization is not working.  When the boards are running, should I be able to read the sample rate or clock source from the PFI2 channel?  Am I misunderstanding something?Thanks!
BrowningG
2008-07-30 17:10:11 UTC
Permalink
Hello DAQ question,

Welcome to the NI Discussion Forums!&nbsp; From your post it looks like you would like to synchronize two USB-6251 devices using their sample clocks.&nbsp; This <a href="http://forums.ni.com/ni/board/message?board.id=250&amp;message.id=10165" target="_blank">forum post</a>&nbsp;involves some great information on how to get started with using DAQmx. &nbsp; To perform sample clock synchronization, there are several steps to follow.&nbsp;

1. Choose one device to be the master device and one to be the slave.&nbsp; The master device will handle the timing and starting of both devices.

2. On the master device you will need to export your sample clock to a PFI line so that it can be wired to the slave device.&nbsp; Use the function (from the DAQmx C Reference Help) DAQmxExportSignal.&nbsp; This function allows for you to export a hardware signal to a PFI line that you specify.&nbsp; You can then wire this PFI line to your slave device.&nbsp;

3. On the slave device set the sample clock source to be the PFI line that has the master device?s sample clock attached to it.&nbsp;

4. Start the slave task first, then the master task.&nbsp; This will ensure that the slave task is waiting for the sample clock from the master device so they both start when the master starts.&nbsp; If you start the master task first, the slave and the master will be clocking at the same time but the master task could have a few extra samples.&nbsp;

I hope this helps, post back if you have any more questions.&nbsp; Also, check out this <a href="http://zone.ni.com/devzone/cda/tut/p/id/3615" target="_blank">tutorial</a>&nbsp;for an explanation on how the different synchronization schemes work with M Series devices. &nbsp;
DAQ question
2008-08-01 14:10:11 UTC
Permalink
Thank you for the suggestions.&nbsp; I've read through all the material and attempted to use the suggestions and posted&nbsp; in the links you sent.&nbsp; Unfortunately, I have not been able to get any of it to work.&nbsp; I've been corresponding with a Matlab tech and their final word at the moment is that it is not possible to synchronize two boards using a board-generated clocksource.&nbsp; I would be so happy to hear that there is another way.
BrowningG
2008-08-04 23:10:12 UTC
Permalink
Hello DAQ question,

The term synchronization depends on how tightly synchronized you would like your two boards to be synchronized.&nbsp; The simplest form of synchronization is to have to tasks running at the same rate that are both started at the same time.&nbsp; Reference clock and sample clock synchronization provide a much tighter method to synchronize boards by sharing clocks and triggers.&nbsp; For your USB devices, the tightest synchronization you can get would be to share a sample clock between the two devices.&nbsp; One way is to export the sample clock from one board to be used as an external sample clock for the other board.&nbsp; You could also try importing an external sample clock to both devices from a function generator or the onboard counters.&nbsp; This way both devices would have the same external sample clock.&nbsp;

For example, create a counter output task on one device.&nbsp; This task will output pulses continuously on one of the PFI lines of the device.&nbsp; Then, create the AI tasks for both boards that use an external sample clock.&nbsp; You can then wire the PFI line that is outputting pulses to the sample clock input terminal you specify for both AI tasks.&nbsp; This will provide sample clock synchronization.&nbsp;

You could also just have both tasks run at the same rate and start them at the same time.&nbsp; This will not be the tightest synchronization, but it is the simplest.&nbsp;
Loading...