| Data Acquisition Toolbox | Search  Help Desk |
| HwChannel | Examples See Also |
HwChannel contains the hardware channel IDs. For National Instruments hardware, channel ID's are zero-based. For Hewlett-Packard hardware and sound cards, channel ID's are one-based.
The elements of HwChannel are defined when hardware channels are associated with a device object with the addchannel function. If you are using scanning hardware, then HwChannel determines the scanning order. Namely, the first HwChannel element is sampled first, the second HwChannel element is sampled second, and so on.
Each hardware channel has an associated MATLAB index. To assign or return property values for individual channels, or to rearrange the scan order, you must address the hardware channels by their index with the Channel property.
A hardware channel can be assigned to multiple device objects, or multiple times to the same device object. For sound cards however, hardware channels cannot be assigned multiple times to the same device object.
Characteristics
| Device Objects | AI, AO |
| Class | Channel |
| Access | Read/write |
| Data Type | Array of doubles |
| Modify while Running | No |
Values
The values are specified when channels are added to the device object with theaddchannel function.
Example
Suppose you create the analog input objectai for a National Instruments board and add the first four hardware channels
ai = analoginput('nidaq', 1)
addchannel(ai, 0:3)
These channels are automatically assigned the MATLAB indices 1-4, and the scan order is given by HwChannel. Namely, channel 1 is sampled first, channel 2 is sampled second, and so on.
See Also
Properties
Channel, ChannelName, Index