LineName - Specify descriptive line name

Description

LineName specifies a descriptive name for a hardware line. If a line name is defined, then you can reference that line by its name. If a line name is not defined, then the line must be referenced by its index. Line names are not required to be unique.

You can also define descriptive line names when lines are added to a digital I/O object with the addline function.

Characteristics

Usage

DIO, Line

Access

Read/write

Data type

String

Read-only when running

Yes

Values

The default value is an empty string. To reference a line by name, it must contain only letters, numbers, and underscores and must begin with a letter.

Examples

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

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

To assign a descriptive name to the first line contained by dio:

line1 = dio.Line(1);
set(line1,'LineName','Joe')

You can now reference this line by name instead of index.

set(dio.Joe,'Direction','In')

See Also

Functions

addline

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS