07-22-2010 02:07 PM
I have a customer who needs to sync his PCI-6110 to another (non-NI) device. Is there a way to tell the 6110 to use an external source as the master clock?
If he just needs to sync analog input scan rates, can he input the master scan clock from an external source? Would that be the /Dev1/20MHzTimebase (assuming Dev1)?
Just to complicate things, I'm working C/C++.
Thanks!
07-23-2010 03:44 PM
Hey John,
There are some C/C++ example programs available in the following directory for using an external clock source:
Windows XP and Earlier:
C:\Documents and Settings\All Users\Documents\National Instruments\NI-DAQ\Examples\DAQmx ANSI C
Windows Vista and Windows 7:
C:\Users\Public\Documents\National Instruments\NI-DAQ\Examples\DAQmx ANSI C
You will notice in the examples that implement the external clock source, the code that configures the sample clock looks something like this:
DAQmxCfgSampClkTiming(taskHandle,"/Dev1/PFI7",1000.0,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,1000)
The clock source is being defined as "/Dev1/PFI7," which is the channel that the external clock is connected. When using the internal source (in your case, it's the 20 MHz timebase), this parameter is not defined.
Let me know if this does not fully answer your question.
07-23-2010 06:00 PM
Thank you, Sara.
I know how to use an external clock source for scanning and waveform generation, etc.
What I want to know is how to set up an external master clock for the board so that it can be synched to another device. In this case, the other device is not an NI device so there is no RTSI bus.
It would be acceptable if, instead of the master clock for the board, if there were a way to connect a master time base for scanning from an external source.
07-26-2010 04:17 PM
Hi John,
With the PCI 6110 you can import a master time base onto RTSI7 and specify the rate with:
DAQmxSetMasterTimebaseSrc(TaskHandle taskHandle, const char *data);
And DAQmxSetMasterTimebaseRate(TaskHandle taskHandle, float64 data);
You need to specify the expected rate of the timebase if you supply it externally. If you go to start>> Programs>>National Instruments> NI DAQ>>Text Based Code Support you will find the NI-DAQmx C Reference Help which has a lot of useful information about available functions and properties for your card.
07-26-2010 05:24 PM - edited 07-26-2010 05:24 PM
John,
Since RTSI is not an option for you, you can use an external clock as a sample clock timebase source. To do this, you should use DAQmxSetSampClkTimebaseSrc and DAQmxSetSampClkTimebaseRate. The 6110 should support routing this signal through any of the device's PFI lines. Once you've set this DAQmx should use the specified signal as the ai/SampleClockTimebase and calculate the necessary divide down for your sample clock based on the clock rate you specify. Optionally, you can set the sample clock's divisor explicitly by using DAQmxSetSampClkTimebaseDiv.
If you need more details on these functions, let me know.
Dan
07-26-2010 05:27 PM
Thanks, Matt. That's exactly the information I was looking for.
And I see from the NI-DAQmx C Help that the source can be only on-board, or RTSI pin 7. Is there documentation that would allow my customer to drive the RTSI bus from a non-NI device?
07-26-2010 05:39 PM
Hi John,
The Master Timebase can only be driven from RTSI 7. This is different from the AI Sample Clock Timebase which can be driven from any PFI line or from RTSI 0:6:
The difference is that the AI Sample Clock Timebase is exclusive to AI tasks, while the Master Timebase is shared across the entire board and is used for many other purposes.
Best Regards,
08-03-2010 04:58 PM
Matt-
@Mr.F wrote:
DAQmxSetMasterTimebaseSrc(TaskHandle taskHandle, const char *data);
And DAQmxSetMasterTimebaseRate(TaskHandle taskHandle, float64 data);
I just realized that I'm confused about something here. I was under the impression that the master timebase was the timebase used as the master for a number of different functions including analog input scanning, waveform generation, and counter pulse train generation. As such, where does the task handle come from? Do you have to create a special task just to set the master timebase?
Thanks!
08-05-2010 10:54 AM
John,
You are correct, there is one 'master timebase' which will be used as the internal source for many of the device's subsystems. By default, this is driven by a 20 MHz oscillator on your device. This can however, be driven by a signal coming from RTSI 7 on the 6110. The master timebase source can be set by any task in the system, so no, you don't need a special task to do this. However, when a task makes a route to set the master timebase source and rate, the driver will reserve and remember this configuration. Therefore any subsequent task which attempts to configure this source/rate differently will receive a routing error. If the subsequent task uses the same settings, it should not receive this error.
One other thing to remember is that by default, most subsystems will use an internal timebase which derives from this master timebase. However, most subsystems can use an external clock for their timebase as well. This is demonstrated by the middle box in the diagram that John posted. As shown, a signal like ai/SampleClockTimebase can be driven by either the master timebase, or from PFI 0-9 or RTSI 0-6. This is what I was recommending that you do if you don't have access to the RTSI connector. You can use an external signal as your ai/timebase. This means that all AI clocks will be derived from the external timebase rather than the internal (by default master) timebase. This route would not affect any other subsystem on the 6110. I hope that helps clear up your questions. If not, post back.
Hope that helps,
Dan
08-05-2010 03:28 PM
@Mcdan wrote:
You are correct, there is one 'master timebase' which will be used as the internal source for many of the device's subsystems. By default, this is driven by a 20 MHz oscillator on your device. This can however, be driven by a signal coming from RTSI 7 on the 6110. The master timebase source can be set by any task in the system, so no, you don't need a special task to do this. However, when a task makes a route to set the master timebase source and rate, the driver will reserve and remember this configuration. Therefore any subsequent task which attempts to configure this source/rate differently will receive a routing error. If the subsequent task uses the same settings, it should not receive this error.
So I need to create an analog input scan task (for instance) and use that task when setting the master timebase source and rate? Other tasks won't be bothered by this as long as they don't contradict the setting? Or do other tasks also have to set the same master timebase properties?
One other thing to remember is that by default, most subsystems will use an internal timebase which derives from this master timebase. However, most subsystems can use an external clock for their timebase as well. This is demonstrated by the middle box in the diagram that John posted. As shown, a signal like ai/SampleClockTimebase can be driven by either the master timebase, or from PFI 0-9 or RTSI 0-6. This is what I was recommending that you do if you don't have access to the RTSI connector. You can use an external signal as your ai/timebase. This means that all AI clocks will be derived from the external timebase rather than the internal (by default master) timebase. This route would not affect any other subsystem on the 6110. I hope that helps clear up your questions. If not, post back.
My customer wants to sync his Acqiris ultra-high-speed DAQ device with his 6110. The Acqiris device produces an appropriate signal for the purpose, but doesn't produce the appropriate signal for an external sample clock. If that had been acceptable, I would have solved this long ago!
Thanks for the help, Dan!