Main Content

Clock Connections

When to Use Clocks

Use clocks to synchronize operations on all connected devices in the DataAcquisition. You connect a clock source to a clock destination. A clock source can be either external, where the clock signal comes from a source outside a DataAcquisition, or on a device and terminal pair within a DataAcquisition. Destination devices can be external, where the signals are received outside the DataAcquisition, or devices within the DataAcquisition. For more information, see Source and Destination Devices.


You cannot use trigger and clock connections with audio channels.

Import Scan Clock from External Source

To import a scan clock from an external source, you must connect the external clock to a terminal and device pair on a device in your DataAcquisition. Two circumstances of externally clocked synchronization include:

  • Synchronizing operations on all devices within a DataAcquisition by sharing the clock on a device within the DataAcquisition or an external clock

  • Synchronizing operations on all devices within a DataAcquisition and some external devices, by sharing an external clock


Importing an external clock does not automatically set the scan rate of your DataAcquisition. Manually set the DataAcquisition Rate property value to match the expected external clock frequency.

Export Scan Clock to External System

This example shows how to add a scan clock to a device and output the clock to a device outside your DataAcquisition, which is connected to an oscilloscope. The scan clock controls the operations on the external device.

Create a DataAcquisition and add a voltage input channel from an NI USB-6211 with device ID Dev1.

d = daq("ni");

Add a clock to the DataAcquisition, to export an external scan clock sourced at terminal PFI6 on Dev1, and physically connect it to an external destination.

c = addclock(d,"ScanClock","Dev1/PFI6","External")
c = 

  Clock with properties:

         Source: 'Dev1/PFI6'
    Destination: 'External'
           Type: ScanClock

Acquire data and store it in dataIn.

dataIn = read(d,seconds(1),"OutputFormat","Matrix");

Related Examples

More About