Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronizing 2 devices 6216 VC++

Hi,

 

I'm using 2 USB-6216 and trying to synchronize DAQ1 channel 1 to data on DAQ 2 channel 1 and so on.  I setup the DAQs as follow

1) The Differential Inputs are paired A0:A8, A1:A9, A2:A10....

2)   Hook the PFI0 of each of the DAQs together

3)  Using Function Generator to generate a sine wave on the odd channels and even channels grounded.

4) Using Function Generator to generate digital trigger output on PFI0

5) Read the resulting samples and determine the difference between each of the odd channels between the DAQs in a given sample set.

 

My results are not as expected.  Using Excel to plot the data I see that the data of the 2 DAQs are shifted on every sample set. 

 

Addtional test 

I configured the DAQs to use external clock on PFI12 and using the MAX test pannel (Counter I/O) to generate clock signal on PFI12 at 100000 frequency.  I route the PFI12 of two DAQs togethter.  In this experiment, both DAQs share the same trigger source and clock source.  The results are not in sync. 

 

Here are my questions

1) is there anything wrong with my 2 experiments above?

2) is it possible to truely synchronize 2 devices using NI-USB 6216?

3) how to setup hardware/software to share the clock?  

0 Kudos
Message 1 of 5
(7,238 Views)

Hello,

 

You can setup your system so all the settings for initializing are configured on both the devices and you are just waiting on the clock source. Send the counter input to one PFI line and then route that signal as clock source to another PFI line on both the devices. For example, send the counter output to PFI11 and then route that signal as clock source on PFI12 of both the devices. This way both the devices will receive the clock source at the same time and will start acquiring.

 

Thank you,

Simran K
National Instruments
Applications Engineer
0 Kudos
Message 2 of 5
(7,216 Views)
 

Hi Simran,

I'm using MS Studio 2005 and using NI Measurement Studio 8.7.1.  I know how to setup for both devices to share the same trigger line but I do not know how to setup for both devices  to share the same clock source.  Do you have an example code? 

 

On your statement "You can setup your system so all the settings for initializing are configured on both the devices and you are just waiting on the clock source." does this means I should set the sample clock settings to use the external clock on PFI12 for example?

 

"Send the counter input to one PFI line and then route that signal as clock source to another PFI line on both the devices" do I do this in software or hardware?  If in software can you give me an example?

 

Thanks,

 

Tuan Bui

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

Simran_K wrote:

Hello,

 

You can setup your system so all the settings for initializing are configured on both the devices and you are just waiting on the clock source. Send the counter input to one PFI line and then route that signal as clock source to another PFI line on both the devices. For example, send the counter output to PFI11 and then route that signal as clock source on PFI12 of both the devices. This way both the devices will receive the clock source at the same time and will start acquiring.

 

Thank you,


 

 

Hi Simran,

I'm using MS Studio 2005 and using NI Measurement Studio 8.7.1.  I know how to setup for both devices to share the same trigger line but I do not know how to setup for both devices  to share the same clock source.  Do you have an example code? 

 

On your statement "You can setup your system so all the settings for initializing are configured on both the devices and you are just waiting on the clock source." does this means I should set the sample clock settings to use the external clock on PFI12 for example?

 

"Send the counter input to one PFI line and then route that signal as clock source to another PFI line on both the devices" do I do this in software or hardware?  If in software can you give me an example?

 

Thanks,

 

Tuan Bui

0 Kudos
Message 4 of 5
(7,184 Views)

Hello,

 

If you have the DAQmx driver installed, the examples should be located at a path similar to C:\Documents and Settings\All Users\Documents\National Instruments\NI-DAQ\Examples\DAQmx ANSI C. Look under Analog In and Synchronization.

 

You mentioned you were generating a clock signal on PFI12 and that was the signal I was referring to. I meant configure your DAQmx tasks for measurement and then wait on the clock signal to start.

 

Thank you,

Simran K
National Instruments
Applications Engineer
0 Kudos
Message 5 of 5
(7,165 Views)