Data Acquisition Toolbox    

Adding Channels or Lines

Channels and lines are the basic hardware device elements with which you acquire or output data.

After you create a device object, you must add channels or lines to it. Channels are added to analog input and analog output objects, while lines are added to digital I/O objects. The channels added to a device object constitute a channel group, while the lines added to a device object constitute a line group.

The functions associated with adding channels or lines to a device object are listed below.

Table 3-2: Functions Associated with Adding Channels or Lines
Functions
Description
addchannel
Add hardware channels to an analog input or analog output object.
addline
Add hardware lines to a digital I/O object.
addmuxchannel
Add channels when using a National Instruments AMUX-64T multiplexer.

For example, to add two channels to an analog input object associated with a sound card, you must supply the appropriate hardware channel identifiers (IDs) to addchannel.

You can think of a device object as a channel or line container that reflects the common functionality of a particular device. The common functionality of a device applies to all channels or lines that it contains. For example, the sampling rate of an analog input object applies to all channels contained by that object. In contrast, the channels and lines contained by the device object reflect the functionality of a particular channel or line. For example, you can configure the input range (gain and polarity) on a per-channel basis.

The relationship between an analog input object and the channels it contains is shown below.

For digital I/O objects, the diagram would look the same except that lines would be substituted for channels.


  Where Do Device Objects Exist? Mapping Hardware Channel IDs to MATLAB Indices