Skip to Main Content Skip to Search
Product Documentation

addAnalogInputChannel - Class: daq.Session
Package: daq

Add analog input channel

Syntax

s.addAnalogInputChannel(deviceID, channelID, measurementType)
ch = s.addAnalogInputChannel(deviceID, channelID, measurementType)
[ch, idx] = s.addAnalogInputChannel(deviceID, channelID, measurementType)

Description

s.addAnalogInputChannel(deviceID, channelID, measurementType) adds a channel on the device represented by deviceID, with the specified channelID, and channel measurement type, represented by measurementType, to the session s. Measurement types are vendor specific.

ch = s.addAnalogInputChannel(deviceID, channelID, measurementType) creates and displays the object ch.

[ch, idx] = s.addAnalogInputChannel(deviceID, channelID, measurementType) creates and displays the object ch, representing the channel that was added and the index, idx, which is an index into the array of the session object's Channels property.

Tips

Input Arguments

deviceID

Specify the vendor-defined ID of the device on the CompactDAQ chassis. The specified channel is created for this device. The device ID is the ID of the device that you obtain by calling daq.getDevices.

channelID

Specify the ID of the channel added to the device. You can also add a range of channels.

For NI devices, use either a terminal name, like 'ai2', or a numeric equivalent like 2 for the channel ID.

    Note   Channel ID is the physical location of the channel on the device. The index for this channel displayed in the session indicates this channels position in the session. If you add a channel with channel ID ‘ai2' as the first channel in your session, the session index will be 1.

measurementType

Specify a string that represents a vendor-defined measurement type. Measurement types include:

  • 'Voltage'

  • 'Thermocouple'

  • 'Current'

  • 'Accelerometer'

  • 'RTD'

  • 'Bridge'

  • 'Microphone'

  • 'IEPE'

Output Arguments

ch

Object representing the channel you added.

idx

An index into the array of the session object's Channels property.

Properties

ADCTimingModeSet channel timing mode
BridgeModeSpecify analog input device bridge mode
CouplingSpecify input coupling mode
DeviceAnalog and counter channel device
ExcitationCurrentVoltage of external source of excitation
ExcitationSourceExternal source of excitation
ExcitationVoltageVoltage of excitation source
ExternalTriggerTimeoutIndicate if external trigger timed out
IDAnalog and counter channel ID
InputTypeSpecify analog input hardware channel configuration
MaxSoundPressureLevelSound pressure level for microphone channels
MeasurementType Type counter channel measurement
NameSpecify descriptive name for the channel
NominalBridgeResistanceResistance of sensor
R0Specify resistance value
RangeSpecify channel measurement range
RTDConfigurationSpecify wiring configuration of RTD device
RTDTypeSpecify sensor sensitivity
ScansAcquiredNumber of scans acquired during operation
SensitivitySensitivity of an analog channel
ShuntLocation Indicate location of channel's shunt resistor
ShuntResistanceResistance value of channel's shunt resistor
ThermocoupleTypeSelect thermocouple type
UnitsSpecify unit of RTD measurement

Examples

Add an analog input current channel:

s = daq.createSession ('ni')
s.addAnalogInputChannel('cDAQ1Mod3','ai0', 'Current');

Add an analog input thermocouple channel. Specify output arguments to represent the channel object and the index:

s = daq.createSession ('ni')
[ch, idx] = s.addAnalogInputChannel('cDAQ2Mod6', 'ai0', 'Thermocouple')

Add analog input voltage channels 0, 2, and 4:

s = daq.createSession ('ni')
s.addAnalogInputChannel('cDAQ1Mod1',[0 2 4], 'Voltage');
 

See Also

daq.Session | daq.Session.addAnalogOutputChannel | daq.Session.removeChannel | daq.Session.startBackground | daq.Session.startForeground

How To

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS