xPC Target    

I/O Port Read

Intel 80x86 and compatible processors have a special address space reserved for I/O devices. To access this address space and communicate directly to a device, xPC Target 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.
  1. The Block Parameters: I/O Port Read dialog box opens.

  1. In the I/O-Port address box, enter the beginning address for each value this block reads.
  1. 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

  1. 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.
  1. For example if you want to read a word and then a byte, enter

    Your dialog box should look similar to the figure shown below.

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

    Block Parameters
    Description
    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 strings.
    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 a base sample time or a multiple of the base sample time.


  xPC Target Software Reboot I/O Port Write