| Contents | Index |
| On this page… |
|---|
Most target PCs have a parallel port that you can use for a variety of devices. The xPC Target block library provides blocks that enable you to use the parallel ports of a target PC for digital input and output, and source interrupts.
Warning The parallel port is part of the motherboard on many PCs. Be careful when configuring the port and connecting external hardware to the port. Incorrect connections to the port might damage your PC. |
The xPC Target 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
| Function | Channel | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Additional Pins |
|---|---|---|---|---|---|---|---|---|---|---|
| Bit | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | ||
| Digital Input | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | ||
| Digital Output | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | ||
| Digital Input (Status) | 15 | 13 | 12 | 10 | 11 | |||||
| Digital Output (Control) | 01 | 14 | 16 | 17 | ||||||
| Interrupt | 10 | |||||||||

To use the parallel port as an interrupt source, use pin 10 of the parallel port as the interrupt source. Configure the xPC Target model as follows:
Select Simulation > Configuration Parameters > xPC Target options.
In the Execution options pane:
From Execution mode, select Real-Time.
From Real-time interrupt source, select the IRQ level (typically 7).
From I/O board generating the interrupt, select Parallel_Port.
In PCI slot (-1: autosearch) or ISA base address, enter the base address of the parallel port (typically 0x378).
If you want to use the Async IRQ Source block, you do not have to configure the model. Instead, you can set the Async IRQ Source block parameters as follows:
IRQ line number — Select the IRQ level (typically 7).
Allow preemption of function-call subsystem — Set as you wish.
I/O board generating the interrupt — Select Parallel_Port.
PCI slot — Enter the base address of the parallel port (typically 0x378).
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, use the xpctarget.xpc.getxpcpci function with the 'verbose' option. For example
getxpcpci('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 Other.
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.
Note You cannot use add-on parallel port boards as interrupt sources. You also cannot trigger the execution of a model with these boards. |
![]() | Parallel Ports | Boards and Blocks — Alphabetical List | ![]() |

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 |