Use I/O Boards

Typically I/O boards are preset from the factory for certain base addresses, voltage levels, and unipolar or bipolar modes of operation. Boards often include switches or jumpers that allow you to change many of these initial settings. For information about setting up and installing an I/O board, read the board manufacturer's documentation.

For an online list of I/O boards that Real-Time Windows Target™ software supports, see Supported I/O Boards.

Install and Configure I/O Boards and Drivers

A Real-Time Windows Target model connects to a board by including an I/O driver block. This block provides an interface to the board's device driver and the board-specific settings. The device drivers included with the Real-Time Windows Target software usually provide the same flexibility of settings offered by the board manufacturer. You can enter I/O board settings by using the I/O Block Parameters dialog box; setting jumpers and switches on the board; or both. The three types of board settings are:

  • Software selectable — Specify the desired settings in the I/O Block Parameters dialog box. The driver writes the settings you specify to the board. Examples include A/D gain inputs and selecting unipolar or bipolar D/A outputs.

  • Hardware selectable and software readable — Specify the desired settings by configuring jumpers or switches on the board. The driver reads the settings you selected and displays them in the I/O Block Parameters dialog box.

  • Hardware selectable, but not software readable — Set jumpers or switches on the physical board, and then enter the same settings in the I/O Block Parameters dialog box. These entries must match the hardware jumpers or switches you set on the board. Use this type of setting when the board manufacturer does not provide a means for the I/O driver to write or read the board settings. Examples include base address, D/A gain, and differential or single-ended A/D inputs.

You can configure a Real-Time Windows Target model to use an I/O board whether or not the board exists in the computer, but you will not be able to run the model until the board is installed with its jumpers and switches set. Details of installation and configuration depend on the data transfer direction and the specific board, but are similar in most cases. Details for various types of boards and drivers appear later in this topic.

The following instructions use the HUMUSOFT® AD512 I/O board as an example, configure the board for analog input, and assume that you have physically configured and installed the board in your computer before you add its driver to your model. Customize the steps to achieve the results you need.

To install and configure an I/O board and its driver,

  1. Install the board in the computer, setting jumpers or switches according to the board documentation.

  2. In the model window, choose View > Library Browser to display the Simulink® Library Browser.

  3. Drag an Analog Input I/O driver block into your model from the Real-Time Windows Target library.

  4. Double-click the driver block in the model.

    The I/O Block Parameters dialog box opens.

  5. Click Install new board. From the list that appears, point to a manufacturer, then select a board type. For example, point to Humusoft, then click AD512.

    The I/O board dialog box opens. The name of this dialog box depends on which I/O board you selected.

  6. Select one of the following, as required by the board type:

    • For an ISA bus board, enter a hexadecimal base address. This value must match the base address jumpers or switches set on the physical board. For example, to enter a base address of 0x300, in the Address box type

      	300

      You can also select the base address by checking boxes A9 through A3.

    • For a PCI bus board, enter the logical device number in the Device order box or check Auto-detect.

  7. Set the other required block parameters using the I/O Block Parameters dialog box.

  8. Click Test.

    The Real-Time Windows Target kernel tries to connect to the selected board, and if it does so without an error, displays a message indicating that it found the board.

  9. Click OK on the message box, and again on the I/O Block Parameters dialog box.

    The I/O Block Parameters dialog box closes, and the parameter values are included in your Simulink model.

Multiple Boards of Identical Type

When multiple boards of identical type exist, you must execute the complete installation sequence for each board, just as you would if the boards were of different types. Thus, two identical PCI boards result in two entries in the list of installed boards. The entries differ only in the logical device number shown in the Device order box for each board.

Autodetect Multiple Boards.  The Autodetect feature cannot be used to locate multiple boards of the same type. You must specify their logical device numbers manually.

Multiple Driver Blocks for One Board

Once you have used the I/O Block Parameters dialog box to add a board and configure its driver, you can add additional I/O driver blocks that connect to the same board from other locations in the model. To do this, drag the required driver block into the model, open its I/O Block Parameters dialog box, and choose the board from the list of installed boards.

Scope of Driver Block Parameters.  I/O driver blocks that use a given board share identical parameters. You need to specify these parameters only once, when you first add the board and configure its driver. If you subsequently change a parameter in a driver block connected to a board, the same change occurs in the other driver blocks connected to that board.

ISA Bus Board

Most ISA bus I/O boards are preset with a base address of 0x300. If you are using multiple I/O boards or other boards (for example, network cards) that already use the address 0x300, you must set your board with another base address.

In the I/O board dialog box, enter the same base address that you set on the physical board. You open the I/O board dialog box from an I/O driver Block Parameters dialog box.

PCI Bus Board

You do not have to set a base address for a PCI board. The plug-and-play feature of the Windows® operating system assigns a PCI slot number and logical device number. You can enter the logical device number in the Device order box, or you can let the driver determine the device number for you. The Device order box is in the I/O board dialog box, which you can open from an I/O driver Block Parameters dialog box.

Before you use a PCI or PCMCIA board, you should install the drivers supplied by the board manufacturer. The Real-Time Windows Target software does not use these manufacturer-supplied drivers. However, they sometimes initiate the plug-and-play recognition of the board. Without these drivers installed, the board might be invisible to your computer and to the Real-Time Windows Target software.

Write PCI Bus Board Drivers

Real-Time Windows Target applications cannot use Windows DLLs and kernel-mode drivers, which are not suitable for real-time operation. The device drivers supported by the Real-Time Windows Target software are listed at Supported I/O Boards. If no driver is listed for the board that you want to use, you may be able to write a custom device driver.

A user-written custom device driver must program the board directly at the register level. All supported Real-Time Windows Target drivers use this technique. The Real-Time Windows Target software supports I/O mapped board registers for custom device drivers. The Real-Time Windows Target software does not support memory-mapped board registers for custom device drivers.

If you want to use an unsupported board that you believe should be supported, contact MathWorks Technical Support.

PC/104 Board

Most PC/104 bus I/O boards are preset with a base address of 0x300. If you are using multiple I/O boards or other boards (for example, network cards) that already use the address 0x300, you must set your board with another base address.

In the I/O board dialog box, enter the same base address that you set on the physical board. You open the I/O board dialog box from an I/O driver Block Parameters dialog box.

Compact PCI Board

Using a compact PCI board (PXI®, PXI Express) requires you to use a compact PC (industrial PC). In addition, you need to install the Windows operating system, the MATLAB® environment, Simulink software, and Real-Time Windows Target software on the compact PC.

PCMCIA Board

The plug-and-play feature of the Windows operating system assigns a base address automatically. You can enter this address in the I/O board dialog box, or you can let the driver determine the address for you. You open the I/O board dialog box from an I/O driver Block Parameters dialog box.

Before you use a PCI or PCMCIA board, install the drivers supplied by the board manufacturer. Real-Time Windows Target software does not use these manufacturer-supplied drivers. However, they sometimes initiate the plug-and-play recognition of the board. Without these drivers installed, the board might be invisible to your computer and to the Real-Time Windows Target software.

Was this topic helpful?