08-06-2024 01:43 PM
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:
I want to setup something like this:
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!
Solved! Go to Solution.
08-06-2024 07:17 PM
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
08-07-2024 01:13 PM
(I'm posting this as a screenshot because it blocked me from typing this out perhaps due to the code?):
08-07-2024 03:13 PM
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!