Data Acquisition Toolbox    

Creating a Digital I/O Object

You create a digital I/O (DIO) object with the digitalio function. digitalio accepts the adaptor name and the hardware device ID as input arguments. For parallel ports, the device ID is the port label (LPT1, LPT2, or LPT3). For data acquisition boards, the device ID refers to the number associated with the board when it is installed. Note that some vendors refer to the device ID as the device number or the board number. Use the daqhwinfo function to determine the available adaptors and device IDs.

Each DIO object is associated with one parallel port or one subsystem. For example, to create a DIO object associated with a National Instruments board:

The digital I/O object dio now exists in the MATLAB workspace. You can display the class of dio with the whos command.

Once the object is created, the properties listed below are automatically assigned values. These general purpose properties provide descriptive information about the object based on its class type and adaptor.

Table 7-1: Descriptive Digital I/O Properties 
Property Name
Description
Name
Specify a descriptive name for the device object.
Type
Indicate the device object type.

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


  Digital Input/Output The Parallel Port