Data Acquisition Toolbox    
Channel

Contain hardware channels added to a device object

Description

Channel is a vector of all the hardware channels contained by an analog input (AI) or analog output (AO) object. Because a newly created AI or AO object does not contain hardware channels, Channel is initially an empty vector. The size of Channel increases as channels are added with the addchannel function, and decreases as channels are removed using the delete function.

Channel is used to reference one or more individual channels. To reference a channel, you must know its MATLAB index, which is given by the Index property. For example, you must use Channel with the appropriate indices when configuring channel property values.

For scanning hardware, the scan order follows the MATLAB index. Therefore, the hardware channel associated with index 1 is sampled first, the hardware channel associated with index 2 is sampled second, and so on. To change the scan order, you can specify a permutation of the indices with Channel.

Characteristics

Usage
AI, AO, Common
Access
Read/write
Data type
Vector of channels
Read-only when running
Yes

Values

Values are automatically defined when channels are added to the device object with the addchannel function. The default value is an empty column vector.

Example

Create the analog input object ai for a National Instruments card and add three hardware channels to it.

To set a property value for the first channel added (ID = 0), you must reference the channel by its index using the Channel property.

Based on the current configuration, the hardware channels are scanned in order from 0 to 2. To swap the scan order of channels 0 and 1, you can specify the appropriate permutation of the MATLAB indices with Channel.

See Also

Functions

addchannel, delete

Properties

HwChannel, Index


  BufferingMode ChannelName