Add output channel to device interface
The channel information is available from the DataAcquisition
channel and returns a channel object.
ch = addoutput(___)
adds the channel and also returns the channel index from the DataAcquisition interface. The
channel index reflects only the sequence in which channels are added to the DataAcquisition;
not to be confused with the device channel ID.
idx] = addoutput(___)
Add multiple channels to a DataAcquisition, and use indices to view their settings.
d = daq('directsound'); ch1 = addoutput(d,"Audio3","1","Audio"); [ch2,idx2] = addoutput(d,"Audio6","1","Audio"); d.Channels
Index Type Device Channel Measurement Type Range Name _____ ______ ________ _______ ________________ ______________ __________ 1 "audo" "Audio3" "1" "Audio" "-1.0 to +1.0" "Audio3_1" 2 "audo" "Audio6" "1" "Audio" "-1.0 to +1.0" "Audio6_1"
Access one of the channel settings using its index.
deviceID— Device ID
Device ID specified as a character vector or string, as defined by the device
vendor. Obtain the device ID by calling
channelID— Channel ID
Channel ID specified as a numeric value, character vector, or string; often
indicating the physical location of the channel on the device. Supported values are
specific to the vendor and 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 returned for this channel in the DataAcquisition display
indicates the position of this channel. This channel ID is not the same as channel index
in the DataAcquisition: if you add a channel with ID
2 as the first
channel in a DataAcquisition, the DataAcquisition channel index is
measurementType— Channel measurement type
Channel measurement type, specified as a string or character vector.
measurementType represents a vendor-defined measurement type. Valid
measurement types include the following:
Not all devices support all types of measurement.
Channel, returned as a channel object with properties depending on the measurement type as described in Channel Properties.
idx— Channel index
Channel index, returned as a numeric value. With this index, you can access the
array of the DataAcquisition