| Data Acquisition Toolbox | Search  Help Desk |
| Channel | Examples See Also |
Channel is a vector of all the hardware channels contained by an analog input (AI) or analog output (AO) object.
A newly created AI or AO object does not contain any channels. Therefore, Channel is initially an empty vector. The size of Channel increases as channels are added using the addchannel function, and decreases as channels are deleted using the delete function.
Channel may be used to reference one or more channels by index. You must use Channel when assigning or returning channel property values.
If you are using scanning hardware, then the scan order is indicated by the HwChannel property. To change the scan order, you must specify a permutation of the hardware indices with Channel.
Characteristics
| Device Objects | AI, AO |
| Class | Common |
| Access | Read/write |
| Data Type | Vector of channels |
| Modify while Running | No |
Values
The default value is an empty column vector.Example
Suppose you create an analog input object for a National Instruments card and add three hardware channels.ai = analoginput('nidaq',1)
addchannel(ai, 0:2)
To set a property value for a specific channel, 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 must specify the appropriate permutation of the hardware indices.chans = ai.Channel(1);set(chans, 'InputRange', [-5 5]);
ai.Channel([1 2 3]) = ai.Channel([2 1 3])
See Also
Properties
HwChannel
Functions
addchannel, delete