PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I guarentee my two PXIe-6396 cards are using PXIe_CLK100 from PXIe-1083 rather than onboard oscillator for clock?

Solved!
Go to solution

Hello,

I am using the "NI-DAQ™mx C Reference" functions through a MATLAB interface to control my cards. I have a PXIe-1083 chassis with two PXIe-6396 cards. I want to synchronize analog inputs and digital outputs between the two cards. I want the cards to use the PXIe_CLK100 signal supplied from the chassis rather than the on-card oscillators so that I can guarentee that all clocks on the two cards are derived from the same 100 MHz signal (PXIe_CLK100) and are thus synchronized. From the X series manual I see this is possible:

V_lab_0-1722968857160.png

 

I want to setup something like this:

V_lab_1-1722969153320.png

 

So my question is this -> how can I force the cards to use the PXIe_CLK100 signal using the functions provided in the  "NI-DAQ™mx C Reference" through MATLAB? I couldn't find a function to assign this.

 

An alternate approach I was thinking was that I can route the PXI_CLK10 to an RTSI channel using the name format, "/PXI1Slot2/PXI_CLK10", which works fine and then map that to ai/sampleclock (Terminal Names - NI), but I'm not entirely sure that this would work.

 

Any ideas? Seems like a simple thing I am missing (i.e. a function).

 

Thanks!

0 Kudos
Message 1 of 4
(549 Views)
Solution
Accepted by topic author V_lab

Refer to shipping example C:\Users\Public\Documents\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Synchronization\Multi-Device\Continuous AI

 

		case 2: // M Series Sharing Reference Clock for PXI Devices
			DAQmxErrChk (DAQmxSetRefClkSrc(masterTaskHandle,"PXI_Clk10"));
			DAQmxErrChk (DAQmxSetRefClkRate(masterTaskHandle,10000000.0));
			DAQmxErrChk (DAQmxSetRefClkSrc(slaveTaskHandle,"PXI_Clk10"));
			DAQmxErrChk (DAQmxSetRefClkRate(slaveTaskHandle,10000000.0));

Replace the ClkSrc with PXIe_Clk100 and ClkRate with 100M 

-------------------------------------------------------
Applications Engineer | TME Systems
https://tmesystems.net/
Message 2 of 4
(521 Views)

(I'm posting this as a screenshot because it blocked me from typing this out perhaps due to the code?):

V_lab_0-1723054402049.png

 

0 Kudos
Message 3 of 4
(499 Views)

Hello,

 

I actually solved my issue. I just added the ref clock to all of the tasks on the same card. If you don't do this you may get the error -89137 "Specified property value cannot be used, because it requires resources that are currently in use.". 

 

Everything is working well now! 

0 Kudos
Message 4 of 4
(494 Views)