| Products & Services | Industries | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → xPC Target |
| Contents | Index |
| Learn more about xPC Target |
| On this page… |
|---|
The xPC Target software interfaces the target PC to serial devices using either the COM1 or COM2 port of the main board, through Quatech® drivers, through Diamond Systems drivers, or through Commtech drivers.
The xPC Target software supports RS-232 I/O communication with the following:
Serial ports on the target PC
Third-party Quatech PCI boards (http://www.quatech.com)
Third-party Diamond Systems PC/104 boards (http://www.diamondsystems.com)
For the target PC serial ports, the software can use these ports as the RS-232 I/O devices. You can initiate RS-232 communications with these ports and the accompanying xPC Target drivers.
The software also supports the following:
RS-232 — QSC-100 and ESC-100 PCI boards from Quatech
RS-422, RS-485 — QSC-200/300 PCI boards and DSCP-200/300 dual channel PXI boards from Quatech, Fastcom: 422/2-PCI adapter, Fastcom: 422/2-PCI-335 from Commtech (http://www.commtech-fastcom.com)
RS-232, RS-422, RS-485 — Emerald-MM and Emerald-MM-8 PC/104 boards from Diamond Systems. These boards provide 4 and 8 serial ports, respectively. These boards are jumper-configurable for the following models:
EMM-XT, which can support two ports each for RS-232 and RS-232.
EMM-4485–XT, which supports four ports for RS-422 and RS-485.
EMM-4M-XT, which supports four ports for RS-232, RS-422, and RS-485.
See the manufacturer documentation for details on how to configure your jumpers.
The xPC Target block library provides a set of functionally similar drivers for these boards. See RS-232/422/485 Simulink Block Reference for a description of the driver blocks that support the different protocols.
The xPC Target block library supplies two types of drivers to support RS-232 I/O communication, composite and obsolete:
The composite drivers support RS-232 I/O for the target PC serial ports, the Quatech RS-232, RS-422, and RS-485 I/O devices, and the Diamond Systems RS-232 I/O devices. These drivers support communication in asynchronous binary mode. The xPC Target block library uses Simulink blocks for the I/O drivers. The composite drivers provide a simple ASCII encode/decode for the send and receive RS-232, RS-422, and RS-485 blocks. This set of drivers has the descriptive name "composite" because the driver represents each functional piece of the driver as a Simulink block. For more precise behavior, you can customize the RS-232 driver with these blocks.
The composite drivers also include internal drivers, which you might need to access if you need to modify the composite subsystems for your use. Note that you normally should not use the internal drivers, described in Serial Communications Support with Internal Drivers.
The obsolete drivers support RS-232 I/O only for the target PC serial ports. These drivers support synchronous, asynchronous, and binary (asynchronous) communication mode. The xPC Target software uses a model for this RS-232 I/O that includes both Simulink blocks for the I/O drivers and MATLAB structures for sequencing messages and commands. See Serial Communications Obsolete Drivers Support for a description of these drivers.
The xPC Target software supports serial communication with the COM1 and COM2 ports on the target PC.
Your target applications can use these RS-232 ports as I/O devices. Typically, the target PC is connected to an RS-232 device with a NULL modem cable. However, this depends on the DTE/DCE configuration of the devices, and you might not use a NULL modem cable.

If the host PC and target PC are connected using serial communication, one COM port on the target PC is dedicated for communication with the host PC. You cannot use this COM port in your block diagram as an I/O device.
For example, if the target PC uses COM1 for the communication with the host PC, COM1 cannot be used by your block diagram. If you try to use COM1 as an I/O device in your block diagram, an error message is displayed. The error message appears when you attempt to build and download the target application. In this example, you must use COM2 as an I/O device in your block diagram.
If you are using TCP/IP as your host PC to target PC communications protocol, then you can use any of the COM ports for RS-232 I/O.
Note When you use composite driver blocks, COM1 and COM3 often share interrupt line 4. Similarly, COM2 and COM4 often share interrupt line 3. If you use COM1 for host-target communication, you cannot also use COM1 or COM3 in a model. This is because the shared interrupt is caught in the xPC Target operating system. However, if COM3 uses an interrupt different from that for COM1, you can use COM3 in a model while using COM1 for host-target communications. If COM1 and COM3 share an interrupt line, you can use COM2 or COM4 as your RS-232 I/O port. |
![]() | Serial Communications Support | xPC Target RS-232 and 422/485 Drivers (Composite) | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |