Specify hardware line ID
Note: You cannot use the legacy interface on 64-bit MATLAB®. See About the Session-Based Interface to acquire and generate data on a 64-bit MATLAB.
All lines contained by a digital I/O object have a hardware
ID and an associated MATLAB index. The hardware ID is given by
the MATLAB index is given by the
HwLine value is defined when hardware lines
are added to a digital I/O object with the
The beginning line ID value depends on the hardware device. For National Instruments® hardware, line IDs are zero-based (begin at zero).
DIO, per line
Read-only when running
Values are automatically defined when lines are added to the
digital I/O object with the
addline function. The
default value is one.
Suppose you create the digital I/O object
add four hardware lines to it.
dio = digitalio('nidaq','Dev1'); addline(dio,0:3,'out');
addline automatically assigns the indices
1-4 to these hardware lines. You can swap the hardware lines associated
with index 1 and index 2 with
dio.Line(1).HwLine = 1; dio.Line(2).HwLine = 0;