04-30-2018 07:28 PM
Hi!
I have a 10 MHz OCXO (oven-controlled crystal oscillator) that I want to use as the clock for an NI USB-6361 DAQ. This is so that I can synchronize different devices in my experiment.
How can I set up the DAQ to use the 10 MHz OCXO clock?
Other details in case they're relevant: I'm using Windows 7 with 64-bit LabVIEW 2017
Thanks in advance!
Solved! Go to Solution.
05-01-2018 06:35 AM
You should be able to connect your clock to one of the PFI lines and then use DAQmx Timing to set the sample clock source to the PFI you decided to use.
05-01-2018 11:28 AM
I tried (VI screenshot below), but LabVIEW throws an error (Error -200081; Sample rate exceeds the maximum sample rate for the number of channels specified. ) at the DAQmx Start Task VI. Surely I'm doing something silly.
Perhaps you can point me to an example?
Thanks again!
05-01-2018 12:52 PM
Your problem is that you are trying to set a sample rate of 10MHz. Your maximum sample rate with just 1 channel is 2MHz. Now that I thought about it for a little bit, I think what you really want is to use your clock as the reference clock. If this is correct, then what you really need to do is use a DAQmx Timing Property Node and set the Sample Clock->Timebase->Source to your PFI line.
05-01-2018 01:10 PM
I'm not at a LV box to illustrate, I can only describe.
1. There's a fine distinction to make between the "Sample Clock" (which is what you *did* try to configure) and the "Sample Clock Timebase" (which is what you *should* try to configure).
2. Your code is basically telling the task, "use the signal at PFI7 *directly* as a sample clock, and oh, by the way, believe me when I tell you it's running at 10 MHz"
3. What you *need* is a way to tell the task, "use the signal at PFI7 *indirectly* to *derive* a sample clock, and here is some more info about *how*."
4. For that you'll need to dig down using a DAQmx Timing property node. You need PFI7 to be the "Timebase Source" (or maybe it'll be called "Sample Clock Timebase Source"?).
5. You'll also need to find the property with a name like "Sample Clock Timebase Divisor." Wire in the integer divisor that'll divide down from 10 MHz to your desired rate. It may be important to wire in this calculated rate to the "Sample Clock Rate" property -- DAQmx uses the rate to auto-size the task buffer in continuous sampling tasks.
I *think* that should cover it. There may be other approaches that can work -- I know some boards can sync their internal timebases to an external master through a phase-locked loop, but that's something I've done only rarely, only on PXI, and then had to make up a different scheme anyway due to some legacy boards that didn't support that kind of sync.
-Kevin P
05-01-2018 01:15 PM - edited 05-01-2018 01:26 PM
@crossrulz wrote:
Your problem is that you are trying to set a sample rate of 10MHz. Your maximum sample rate with just 1 channel is 2MHz. Now that I thought about it for a little bit, I think what you really want is to use your clock as the reference clock. If this is correct, then what you really need to do is use a DAQmx Timing Property Node and set the Sample Clock->Timebase->Source to your PFI line.
Reference clock. source Tim, (And the rare cross-post with the up-and coming new DAQmx Master which need a bit of clarification)
What I believe you want to do it use you 10MHz VCXO to improve the stability of the DAQ device. That's the Reference Clock. Normally the device uses its own internal reference to synchronize its internal timebases These timebases are then used to derive the other clocks (sample clock, convert clocks ect....)
If I'm Right (Stop laughing... It happens) connect your VCXO to any PFI and select that source.
05-01-2018 01:33 PM
Great - thanks! Using the DAQmx timing property was what I was looking for.
05-01-2018 06:02 PM
Just chiming in to endorse the answer from Jeff Bohrer as a simpler approach than mine for devices that support it. I expect you'll probably need to define the Reference Clock's known *rate* too as well as the source.
-Kevin P