Download Data Acquisition Toolbox User's Guide

Transcript
4
Data Acquisition Workflow
Hardware Channels or Lines
In this section...
“Add Channels and Lines” on page 4-10
“Hardware Channel IDs to the MATLAB Indices” on page 4-11
Add Channels and 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 4-1. 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. This applies only to Traditional NI-DAQ boards.
Note: The Traditional NI-DAQ adaptor will be deprecated in a future version of the
toolbox. If you create a Data Acquisition Toolbox™ object for Traditional NI-DAQ adaptor
in R2008b, you will receive a warning stating that this adaptor will be removed in a
future release. See the supported hardware page at www.mathworks.com/products/daq/
supportedio.html for more information.
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.
ai = analoginput('winsound');
4-10