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.

addAnalogOutputChannel

Add analog output channel to session

Syntax

addAnalogOutputChannel(s,deviceName,channelID,measurementType)
ch = addAnalogOutputChannel(s,deviceName,channelID,measurementType)
[ch,idx] = addAnalogOutputChannel(s,deviceName,channelID,measurementType)

Description

example

addAnalogOutputChannel(s,deviceName,channelID,measurementType) adds an analog output channel on the device represented by deviceID, with the specified channelID, and channel measurement type defined by measurementType, on the session object s. Measurement types are vendor-specific.

example

ch = addAnalogOutputChannel(s,deviceName,channelID,measurementType) creates and returns the channel object ch, representing the channel that was added.

example

[ch,idx] = addAnalogOutputChannel(s,deviceName,channelID,measurementType) creates and returns the object ch, representing the channel that was added, and the object idx, representing the index into the array of the session object Channels property.

Examples

collapse all

s = daq.createSession('ni')
addAnalogOutputChannel(s,'cDAQ1Mod2','ao0','Voltage');
s = daq.createSession('ni')
[ch,idx] = addAnalogOutputChannel(s,'cDAQ1Mod2','ao0','Voltage');
s = daq.createSession('ni')
ch = addAnalogOutputChannel(s,'cDAQ1Mod8',0:3,'Current');

Input Arguments

collapse all

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

For a list of relevant session object properties, see Tips.

Device ID specified as a character vector or string, as defined by the device vendor. Obtain the device ID by calling daq.getDevices.

Data Types: char | string

Channel ID specified as a numeric value, character vector, or string; or the physical location of the channel on the device. You can add multiple channels by specifying the channel ID as a numeric vector, or an array of character vectors or strings. The index for this channel indicates its position in the session display. The channel ID is not the same as the channel index in the session: if you add a channel with ID 2 as the first channel in a session, the session channel index is 1.

Channel measurement type specified as a character vector or string. measurementType represents a vendor-defined measurement type. Supported measurement types include:

  • 'Voltage'

  • 'Current'

Data Types: char | string

Output Arguments

collapse all

Analog output channel, returned as an object containing a 1-by-n array of vendor-specific channel information. Use this channel object to access device and channel properties.

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

Tips

The relevant properties of the data acquisition session are:

DeviceChannel device information
ExcitationCurrentVoltage of external source of excitation
ExcitationSourceExternal source of excitation
ExternalTriggerTimeoutIndicate if external trigger timed out
IDID of channel in session
MaxSoundPressureLevelSound pressure level for microphone channels
MeasurementTypeChannel measurement type
NameSpecify descriptive name for the channel
RangeSpecify channel measurement range
ScansOutputByHardwareIndicate number of scans output by hardware
ScansQueuedIndicate number of scans queued for output
SensitivitySensitivity of an analog channel
TerminalConfigSpecify terminal configuration

Introduced in R2010b

Was this topic helpful?