Data Acquisition Toolbox    

Adding Lines to a Digital I/O Object

After creating the digital I/O (DIO) object, you must add lines to it. As shown by the figure in Adding Channels or Lines, you can think of a device object as a container for lines. The collection of lines contained by the DIO object is referred to as a line group. A line group consists of a mapping between hardware line IDs and MATLAB indices (see below).

When adding lines to a DIO object, you must follow these rules:

You add lines to a digital I/O object with the addline function. addline requires the device object, at least one hardware line ID, and the direction (input or output) of each added line as input arguments. You can optionally specify port IDs, descriptive line names, and an output argument. For example, to add eight output lines from port 0 to the device object dio created in the preceding section:

The output argument hwlines is a line object that reflects the line group contained by dio. You can display the class of hwlines with the whos command.

You can use hwlines to easily access lines. For example, you can configure or return property values for one or more lines. As described in Referencing Individual Hardware Lines, you can also access lines with the Line property.

Once you add lines to a DIO object, the properties listed below are automatically assigned values. These properties provide descriptive information about the lines based on their class type and ID.

Table 7-2: Descriptive Digital I/O Line Properties 
Property Name
Description
HwLine
Specify the hardware line ID.
Index
Indicate the MATLAB index of a hardware line.
Parent
Indicate the parent (device object) of a line.
Type
Indicate a line.

You can display the values of these properties for chans with the get function.


  The Parallel Port Line and Port Characteristics