Documentation

I/O Port Read

Read Intel 80x86 I/O port (not recommended)

Library

Simulink® Real-Time™ Library of Drivers No Longer Recommended for Use

Description

Intel® 80x86 and compatible processors have a special address space reserved for I/O devices.

Example

To access the special address space and communicate directly to a device, the Simulink Real-Time block library provides the I/O Port Read and I/O Port Write blocks. These blocks enable the transfer of data from and to the I/O ports (see also I/O Port Write).

  1. Double click the I/O Port Read block.

    The Block Parameters: I/O Port Read dialog box opens.

  2. In the I/O-Port address box, enter the beginning address for each value this block reads.

    For example, if you want to read a word (16 bits) starting at I/O port 0x300, followed by a byte (8 bits) at 0x302, enter

    {'0x300','0x302'}
  3. In the Data type box, enter the type for each value this block reads. There is one type for each address you entered in the I/O-Port address box.

    For example if you want to read a word and then a byte, enter

    {'uint16','uint8'}
  4. Click OK.

    The number of outputs from the block changes to reflect the length of the I/O-Port address cell array.

Block Parameters

I/O-Port address (cell array)

This is the cell array containing the beginning I/O port addresses for the data you want to read. These addresses are specified in terms of hexadecimal character vectors.

Data type (cell array)

This is the cell array containing the types of data you want to read from I/O port. The Data type cell array has one value for each value in the I/O-Port address cell array.

The type uint32 reads a double word (32 bits), uint16 reads a word, and a uint8 reads a byte.

Sample time

Enter the base sample time or a multiple of the base sample time (-1 means sample time is inherited).

Was this topic helpful?