Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Sharing an external sample clock between devices

Solved!
Go to solution

I need to acquire samples from 2 seperate M series (PCI-6254) DAQs.  My master device receives an 8 KHz sample clock on PFI0.  Is it possible to root this clock from the master to the slave device over an RTSI cable?  

 

I have looked through the forum and through the example programs but have only found examples in which the Master device's onboard clock is passed to the slave.

 

Is it possibe to synchornize the slave device to the Master device's external sample clock?

 

Thanks,

Ant1  

0 Kudos
Message 1 of 5
(3,552 Views)

Ant1,

 

Not only is it possible, we have a LabVIEW shipping example that does just that.  You can locate the example by selecting Help » Example Finder.  Then switch to the "Search" tab and search on "RTSI".  There will be an example called "Multi-Device Synch-Shared Ext Sample Clk".  This example shows the basic configuration of a LabVIEW program that is sharing an external sample clock over a RTSI cable.  Please let me know if you are using something other than LabVIEW or need any help with the example.

Seth B.
Principal Test Engineer | National Instruments
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 2 of 5
(3,532 Views)

Seth B,

 

Thanks for the quick response.   I am not using labview.  I'm using the nidaqmx under linux

and I am programming in ansi c.  I did read the Multi-Device examples in the ansi_c example

section but I think they only show how to sychronize the onboard clocks.

 

 

Thanks,

Ant1

0 Kudos
Message 3 of 5
(3,527 Views)
Solution
Accepted by topic author ant1

Ant1,

 

Fortunately, for the most part anything that can be done in DAQmx in LabVIEW can be done in ANSI C using the proper function calls.  I've listed the steps below from the LabVIEW sample program, and edited them to remove anything not relevant to the DAQmx setup.  I'm pretty sure this should work for you.

 

Steps:
1.  Create an analog input voltage channel for both the Master and Slave devices.
2.  Set timing parameters.  For the Master, select the source for the external Sample Clock.  For the Slave, set the source to the ai/SampleClock of the Master device .   (Note: The Master's Sample Clock is automatically routed through the RTSI cable.)
3.  For the Slave, set the Source for the trigger to the ai/StartTrigger of the Master device.  This will ensure both devices start sampling at the same time.  (Note:  The trigger is automatically routed through the RTSI cable.)
4.  Call Start Task to start the acquisition.  (Note:  Start the Slave task before the Master task.)
6.  Read all of the waveform data.
7.  Call Clear Task to stop the acquisition and clear the task.

 

So, essentially, set the slave task up the same way as you would for synchronizing onboard clocks, but set the master task up like you would for an external clock.  This will automatically share the external clock and trigger over the RTSI line.

Seth B.
Principal Test Engineer | National Instruments
Certified LabVIEW Architect
Certified TestStand Architect
Message 4 of 5
(3,517 Views)

Thank you Seth,

 

That worked well.

 

Ant1

0 Kudos
Message 5 of 5
(3,511 Views)