Quantcast

Documentation Center

  • Trial Software
  • Product Updates

Line

Contain hardware lines added to device object

Description

    Note:   You cannot use the legacy interface on 64–bit MATLAB®. See Session-Based Interface to acquire and generate data.

Line is a vector of all the hardware lines contained by a digital I/O (DIO) object. Because a newly created DIO object does not contain hardware lines, Line is initially an empty vector. The size of Line increases as lines are added with the addline function, and decreases as lines are removed with the delete function.

You can use Line to reference one or more individual lines. To reference a line, you must know its MATLAB index and hardware ID. The MATLAB index is given by the Index property, while the hardware ID is given by the HwLine property.

Characteristics

Usage

DIO

Access

Read/write

Data type

Vector of lines

Read-only when running

Yes

Values

Values are automatically defined when lines are added to the DIO object with the addline function. The default value is an empty column vector.

Examples

Create the digital I/O object dio and add four input lines to it.

dio = digitalio('nidaq','Dev1');
addline(dio,0:3,'In');

To set a property value for the first line added (ID = 0), you can reference the line by its index using the Line property.

line1 = dio.Line(1);
set(line1,'Direction','Out')

See Also

Functions

addline, delete

Properties

HwLine, Index

Was this topic helpful?