Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem performing Heterogeneous Device(4462 & 4472) Synchronization

Hi,

There is a problem performing Heterogenous Device Synchronization.
My Setup is like this. PXI-4462 in Slot 2 acting as a Master & PXI-4472 in Slot 3 as a Slave
I've kept 4462 in slot 2 because 4462 requires & generates a higher oversample rate than 4472.
For synchronization, I'm going to export this oversample rate("/PXI1Slot2/SampleClockTimebase") of 4462 to 4472 through the PXI Star lines.
Now my issue is in dividing this oversample rate to get a lower rate suitable for 4472 to generate the required sampling rate.
Is there a way to divide this external oversample rate within the device.
There is a method called "DAQmxSetSampClkTimebaseDiv" but this call gives me an error saying "Property cannot be used for the device or task". Also using "DAQmxSetSampClkTimebaseRate" does not seem to give the desired results.
In the Device Routing table of 4462, I can see a signal called "/PXI1Slot2/DividedSampleClockTimebase" & I was wondering whether I can use this as the source terminal but how do I know what frequency it generates or set its rate to be used for 4472.
Please do help me to resolve this issue as I'm in a big trouble 😞

Regards,
Satish Nair
0 Kudos
Message 1 of 13
(5,222 Views)
Satish -

Are you running the 4462 and 4472 at the same sampling rate? If so, I would recommend using the automatic routing features of DAQmx to do the synchronization. There is a shipping example with DAQmx which already shows how to do this. Here is the path to the ANSI C version of the example:

C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Synchronization\Multi-Device\AI-Shared Timebase & Trig-DSA

If you are running the devices at different sampling rates, I would recommend using a 6653 or 6652 to be the timing master because it will provide much more flexibility in the rates that you can use.

-Jack
0 Kudos
Message 2 of 13
(5,200 Views)
Thanks Jack for replying to this question.
Yeah I had used 6653 earlier & it works fine as it can send different oversampling rates required by the devices
viz. "NISYNC_VAL_SYNC_CLK_FULLSPEED" used for 4462's & "NISYNC_ATTR_SYNC_CLK_DIV1" used for 4472's. Only thing to take care of in this configuration is the phase difference's.
But the configuration without the 6653 device is a problem.
As with the shipped example, 4472 tries to use the 4462's oversample rate & since 4462's oversampling rate is comparatively more than the 4472's for the same sampling rate set, continuous acquisition appears to happen slower.
So there should be some way to divide the 4462's rate so that we get a 4472's oversample rate equal to that given by the 4472's backplane when sampleclocktimebase is not shared.
I hope you got what I'm trying to explain.
Thanks & Regards,
Satish.
0 Kudos
Message 3 of 13
(5,190 Views)
Satish -

Did you have a chance to look at the example I referenced?

This example will show you how to synchronize two boards with the SampleClockTimebase at the same sampling rate. This will work when you have two of the same device (i.e. 2 PXI-4472s) or even two different devices (i.e. one 446x and one 4472). In the case when you have two different devices, the 446x devices must be the master. From there, the driver handles the exporting of the correct divided down SampleClockTimebase for you so that both boards will sample at the same rate.

Hope that clears things up.
Jack
0 Kudos
Message 4 of 13
(5,184 Views)
Great!!! The example code worked as per my expectation. The automatic routing feature does the thing.

Earlier I was manually routing the SampleClockTimebase source through the star lines & that works normally if both the card's are PXI-4472 but the same thing does not work if a PXI-446x device is placed in slot 2 & 4472 acting as a slave.

Here is the Routing code(PXI1Slot2 is a 4462 card & PXI1Slot5 is a 4472 card) :

DAQmxConnectTerms("/PXI1Slot2/SampleClockTimebase","/PXI1Slot2/PXI_Star2",DAQmx_Val_DoNotInvertPolarity);
DAQmxConnectTerms("/PXI1Slot5/PXI_Star","/PXI1Slot5/SampleClockTimebase",DAQmx_Val_DoNotInvertPolarity);
DAQmxSetSampClkTimebaseSrc(*slaveTaskHandle,"/PXI1Slot5/PXI_Star");

Jack, Is there a way to use the manual routing feature(any additions to the above code piece) to get the same result as that of automatic routing since my requirement was to create all the hardware routes in the initialization of my program where I don't have any ready-made tasks & automatic routing feature can only be applied to a task.

Thanks for all the help.

Satish.
0 Kudos
Message 5 of 13
(5,168 Views)
Satish -

If you want to do manual routing of the SampleClockTimebase, try this:

//master:
DAQmxSetExportedSignalAttribute (*masterTaskHandle, DAQmx_Exported_DividedSampClkTimebase_OutputTerm, "/PXI1Slot2/PXI_Star0");

//slave:
DAQmxSetTimingAttribute (*slaveTaskHandle, DAQmx_SampClk_Timebase_Src,"/PXI1Slot3/PXI_Star");

You can see that since we have a 446x device as the master and 447x as the slave, we specify the 446x to export its divided sample clock timebase to the slot with the 447x. Just like you mentioned earlier.

Let me know how it goes.
Jack
0 Kudos
Message 6 of 13
(5,158 Views)
Thanks Jack, it worked.

The following code piece also gives me the similar result by setting the Source signal as "DividedSampleClockTimebase"

//Now the source signal is "/PXI1Slot2/DividedSampleClockTimebase" instead of "/PXI1Slot2/SampleClockTimebase"
DAQmxConnectTerms("/PXI1Slot2/DividedSampleClockTimebase","/PXI1Slot2/PXI_Star2",DAQmx_Val_DoNotInvertPolarity);
DAQmxConnectTerms("/PXI1Slot5/PXI_Star","/PXI1Slot5/SampleClockTimebase",DAQmx_Val_DoNotInvertPolarity);
DAQmxSetSampClkTimebaseSrc(*slaveTaskHandle,"/PXI1Slot5/PXI_Star");

Thanks again : )

Satish.
0 Kudos
Message 7 of 13
(5,142 Views)
Hello.

I have PXI-6652 and PXI-4472 modules.
But in my folder
C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Synchronization\Multi-Device\

i haven't "\AI-Shared Timebase & Trig-DSA".
I have only "Continuous AI" and "Finite AI".
I have try "continuosai.c", but i don't understand what part of this code needed to me.

Please, help me to unerstand this.

And, sorry for my bad english :(.

Thanks.
0 Kudos
Message 8 of 13
(4,816 Views)
Hey,

The zip file attached has the example they are talking about. Hope this works for you!

Regards

Malay Duggar
Applications Engineer
National Instruments
0 Kudos
Message 9 of 13
(4,784 Views)
Hey,

Here is the zip file.

Regards
Malay Duggar
Applications Engineer
National Instruments
Message 10 of 13
(4,783 Views)