Skip to Main Content Skip to Search
Product Documentation

I/O Port Write - I/O Port Write

Library

xPC Target Library for Misc.

Description

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

Example

To access this special address space and communicate directly to a device, the xPC Target 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 Read).

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

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

  2. Enter the parameters.

    For example, if you want to write a double word (32 bits) starting at I/O port 0x300, followed by a word (16 bits) at 0x304, enter

    {'0x300','0x304'}

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

  3. Click OK.

    The number of inputs to the block changes to reflect the length of the I/O-Port address cell array. The data type of the input signal reflects the type of value written to the I/O port. For example, an input signal of type uint32 writes a double word, an uint16 input signal writes a word, and an uint8 input signal writes a byte.

Block Parameters

I/O-Port address (cell array)

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

Sample time

Enter a base sample time or a multiple of the base sample time.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS