Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronizing the reference clocks of 2 PCI cards for Analog Inputs with Digital IO

Solved!
Go to solution

I'm trying to syncronize the reference clocks of 2 PCI cards so that the analog inputs are in sync. However, my appilcation also has digtial IO on both cards, and that apparently causes the DAQmxErrorResourcesInUseForRoute_Routing error. This discussion descirbed a similar problem, but the solution was to only set the reference clock on the slave device, which didn't have any other tasks running on it, whereas mine does. 

 

Is there way I can sync the refernce clocks without interfering with the digital IO?

Thanks!

 

PS: My application is in C++.

0 Kudos
Message 1 of 6
(5,026 Views)

Hello Kaladin,

 

Can you please tell us what cards you are using?

 

Are you using a RTSI cable?

 

What is the speed of the reference clock you are using?

 

How many tasks are you attempting to perform?

 

What functions are you using?

0 Kudos
Message 2 of 6
(4,985 Views)

I'm using the PCI-6251 cards. I also tried two PCIe-6351 cards we had lying around. I am using an RTSI cable. I was trying to use the Onboard clock (10MHz).

At the time when I'm trying to sync them, the application is running digital IO and analog input on both cards, plus alaong output on the master card, so 3 for the master and 2 for the slave. To sync the cards I'm using DAQmxSetRefClkSrc, DAQmxSetRefClkRate, DAQmxGetRefClkSrc, DAQmxGetRefClkRate, and DAQmxGetDevProductCategory.

 

The Digital IO are using DAQmxCreateTask, DAQmxCreateDOChan, DAQmxStartTask, DAQmxSetDOTristate, DAQmxWriteDigitalLines, DAQmxReadDigitalLines, DAQmxStopTask, DAQmxClearTask.

 

The analog inputs are using DAQmxCreateTask, DAQmxGetDevProductType, DAQmxSetReadAutoStart, DAQmxCreateAIVoltageChan, DAQmxSetAIDataXferMech, DAQmxCfgSampClkTiming, DAQmxCfgInputBuffer, DAQmxStartTask, DAQmxReadAnalogF64, DAQmxStopTask, and DAQmxClearTask.

 

Whenever I set the refernce clock for a task, when I try to start it via DAQmxStartTask, it fails if there's already another task running on the same card, or if it's the first task running on that card, all subsequent tasks fail with the DAQmxErrorResourcesInUseForRoute_Routing error.

0 Kudos
Message 3 of 6
(4,975 Views)

Any ideas?

0 Kudos
Message 4 of 6
(4,906 Views)
Solution
Accepted by topic author Kaladin

The reference clock is really a lower level component that is shared by all resources on a given device.  All tasks on a given device need to use the same reference clock.  So if you are using DAQmxSetRefClkSrc for one task, you need to use it to set the same value for your other tasks.

 

 

Best Regards,

John Passiak
Message 5 of 6
(4,897 Views)

Thanks John! That explains and solves my problem.

0 Kudos
Message 6 of 6
(4,814 Views)