Data Acquisition Toolbox    

Line and Port Characteristics

As described in the preceding section, when you add lines to a DIO object, they must be configured for either input or output. You read values from an input line and write values to an output line. Whether a given hardware line is addressable for input or output depends on the port it resides on. You can classify digital I/O ports into these two groups based on your ability to address lines individually:

You can return the line and port characteristics with the daqhwinfo function. For example, National Instruments AT-MIO-16DE-10 board has four ports with eight lines per port. To return the digital I/O characteristics for this board:

Display the line characteristics for each port.

This information tells you that you can configure all 32 lines for either input or output, and that the first port is line-configurable while the remaining ports are port-configurable.

Parallel Port Characteristics

The parallel port consists of eight data lines, four control lines, five status lines, and eight ground lines. In normal usage, the lines are controlled by the host computer software and the peripheral device following a protocol such as IEEE Standard 1284-1994. The protocol defines procedures for transferring data such as handshaking, returning status information, and so on. However, the toolbox uses the parallel port as a basic digital I/O device, and no protocol is needed. Therefore, you can use the port to input and output digital values just as you would with a typical DIO subsystem.

To access the physical parallel port lines, most PCs come equipped with one 25-pin female connector, which is shown below.

The lines use TTL logic levels. A line is high (true or asserted) when it is a TTL high level, while a line is low (false or unasserted) when it is a TTL low level. The exceptions are lines 1, 11, 14, and 17, which are hardware inverted.

The toolbox groups the 17 nonground lines into three separate ports. The port IDs and the associated pin numbers are given below.

Table 7-3: Parallel Port IDs and Pin Numbers 
Port ID
Pins
Description
0
2-9
Eight I/O lines, with pin 9 being the most significant bit (MSB).
1
10-13, and 15
Five input lines used for status
2
1, 14, 16, and 17
Four I/O lines used for control

Note that in some cases, port 0 lines might be unidirectional and only output data. If supported by the hardware, you can configure these lines for both input and output with your PC's BIOS by selecting a bidirectional mode such as EPP (Enhanced Parallel Port) or ECP (Extended Capabilities Port).

The parallel port characteristics for the DIO object parport are shown below.

This information tells you that all 17 lines are port-configurable, you can input and output values using the 12 lines associated with ports 0 and 2, and that you can only input values from the five lines associated with port 1.

For easy reference, the LineName property is automatically populated with a name that includes the port pin number.


  Adding Lines to a Digital I/O Object Referencing Individual Hardware Lines