Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

addClockConnection

Add clock connection

Syntax

addClockConnection(s,source,destination,type)
cc = addClockConnection(s,source,destination,type)
[cc,idx] = addClockConnection(s,source,destination,type)

Description

example

addClockConnection(s,source,destination,type) adds a clock connection from the specified source device and terminal to the specified destination device and terminal, of the specified connection type.

example

cc = addClockConnection(s,source,destination,type) adds a clock connection from the specified source device and terminal to the specified destination device and terminal, of the specified connection type and displays it in the variable cc.

example

[cc,idx] = addClockConnection(s,source,destination,type) adds a clock connection from the specified source device and terminal to the specified destination device and terminal, of the specified connection type and displays the connection in the variable cc and the connection index, idx.

Tip

Before adding clock connections, create a session using daq.createSession, and add channels to the session.

Input Arguments

collapse all

Data acquisition session, specified as a session object. Create the session object using daq.createSession. Use the data acquisition session for acquisition and generation operations. Create one session per vendor and use that vendor session to perform all data acquisition operations.

Source for the clock connection, specified as a character vector or string. Valid values are:

  • 'external' — When your clock is based on an external event.

  • 'deviceID/terminal' — When your clock source is on a specific terminal on a device in your session, for example, 'Dev1/PFI1'. For more information on device ID see Device. For more information on terminal see Terminals.

  • 'chassisId/terminal' — When your clock source is on a specific terminal on a chassis in your session, for example, 'cDAQ1/PFI1'. For more information on terminal see Terminals.

You can have only one clock source in a session.

Data Types: char | string

Destination for the clock connection, specified as a character vector or string. Valid values are:

  • 'external' — When your clock source is connected to an external device.

  • 'deviceID/terminal' — When your clock source is connected to another device in your session, for example, 'Dev1/PFI1'. For more information on device ID see Device. For more information on terminal see Terminals.

  • 'chassisId/terminal' — When your clock source is connected to a chassis in your session, for example, 'cDAQ1/PFI1'. For more information on terminal see Terminals.

You can also specify multiple destination devices as an array, for example, {'Dev1/PFI1','Dev2/PFI1'}.

Data Types: char | string | cell

The clock connection type, specified as a character vector or string. 'ScanClock' is the only connection type available for clock connections at this time.

Data Types: char | string

Output Arguments

collapse all

The clock connection that you add, returned as an object containing clock connection information.

Channel index returned as a numeric value. Through the index you can access the array of the session object Channels property.

Properties

DestinationIndicates trigger destination terminal
SourceIndicates trigger source terminal
TerminalsTerminals available on device or CompactDAQ chassis

Examples

collapse all

Create a session and add an analog input channel from Dev1 to the session.

s = daq.createSession('ni')
addAnalogInputChannel(s,'Dev1','ai0','Voltage');

Add a clock connection from an external device to terminal PFI1 on Dev1 using the 'ScanClock' connection type and save the connection settings to a variable:

cc = addClockConnection(s,'external','Dev1/PFI1','ScanClock');

To add clock connection going to an external destination, create a session and add an analog input channel from Dev1 to the session.

s = daq.createSession('ni')
addAnalogInputChannel(s,'Dev1','ai0','Voltage');

Add a clock from terminal PFI0 on Dev1 to an external device using the 'ScanClock' connection type:

addClockConnection(s,'Dev1/PFI1','external','ScanClock');
Was this topic helpful?