Most target computers have a parallel port that you can use for various devices. The Simulink® Real-Time™ block library provides blocks that enable you to use the parallel ports of a target computer for digital input and output, and source interrupts.
The parallel port is part of the motherboard on many computers. Be careful when configuring the port and when connecting external devices to the port. Incorrect connections to the port can damage your computer.
The Simulink Real-Time parallel port blocks assume that the connector to the parallel port has one 25-pin connector whose pins have the following designations:
Eight data pins
Five status pins
Four control pins
Eight ground pins
|Digital Input (Status)||15||13||12||10||11|
|Digital Output (Control)||01||14||16||17|
To use the parallel port as an interrupt source, use pin 10 of the parallel port as the interrupt source. Configure the Simulink Real-Time model as follows:
Open the Configuration Parameters dialog box.
Select Code Generation > Simulink Real-Time Options.
In the Execution options pane:
From Execution mode, select
From Real-time interrupt source, select the IRQ
From I/O board generating the interrupt, select
In PCI slot (-1: autosearch) or ISA base address,
enter the base address of the parallel port (typically
IRQ line number — Select the IRQ level (typically
I/O board generating the interrupt — Select
PCI slot — Enter the base address of the parallel
To use an add-on parallel port board with the parallel port blocks, configure the base address for the board as follows:
To get the base address of a board, in the MATLAB® Command Window, call the function
getPCIInfo with the
'verbose' option. For
tg = slrt; getPCIInfo(tg, 'verbose')
Identify the base address for the add-on parallel port board.
In your model, open the parallel port block and set the value of the
Base address parameter to
The Alternate base address parameter is displayed.
In the Alternate base address parameter, enter the base address you identified in step 2.
Configure the rest of the block as desired.
You cannot use add-on parallel port boards as interrupt sources. You also cannot trigger the execution of a model with these boards.