Using the Onboard Frequency Generator for Hardware-Timed Digital Tasks on M-Series DAQ Device

Updated Nov 27, 2018

Reported In

Reported In shows products that are verified to work for the solution described in this article. This solution might also apply to other similar products or applications.

Driver

NI-DAQmx

Issue Details

I do not have any available counters or analog clocks for hardware timed digital tasks on my M-Series Data Acquisition (DAQ) device. How can I use my onboard frequency generator to use as a sample clock for my digital I/O task?

Solution

To use the frequency generator as the sample clock for your digital task, complete the following steps:

Create a counter output task that will generate a digital pulse train at the divided down rate of the frequency generator.

Specify the channel name of the counter output task to be <NI-DAQmx Device Name>/freqout.

Create a digital input task or digital output task and specify the source for the sample clock as /<NI-DAQmx Device Name>/FrequencyOutput.

Start the digital input or digital output task.

Start the frequency output task when you are ready for the digital task to start acquiring or generating.

Additional Information

Each M Series device has a frequency generator which produces a pulse train by dividing down the 10 MHz or 100 kHz onboard timebase by an integer divisor n = 1, 2, ..., 16. Using the onboard frequency generator limits the sample clock frequencies available to you but is a good option if you do not have an external clock available and are using all of the counters and analog clocks for other independent tasks.