| Products & Services | Solutions | 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… |
|---|
You install the xPC Target software entirely on the host PC. Installing software on the target PC is not necessary. The xPC Target software is distributed on a DVD or as a file you download from the Web.
Note Before you start, ensure that the xPC Target and xPC Target Embedded Option products are not already installed on your host PC. Uninstall both before proceeding if necessary. |
After you install the product, you will need to set up the xPC Target environment for either serial or network communication. See Serial Communication or Network Communication.
Before you install the xPC Target or the xPC Target Embedded Option products, you must have a valid File Installation Key and License File. The File Installation Key identifies the products you purchased from The MathWorks and are permitted to install and use. The License File activates the installation.
If you have not received either of these, go to the License Center at the MathWorks Web site.
The xPC Target family of software includes options that you can purchase and add later to the xPC Target environment.
xPC Target Embedded Option product — With the xPC Target Embedded Option product, you can boot the target PC from a device other than a floppy disk or CD/DVD and deploy stand-alone target applications separate from the host PC.
When using the xPC Target software, you might find it helpful to know where files are located:
MATLAB working folder — Simulink models (model.mdl), xPC Target applications (model.dlm)
Select a working folder outside the MATLAB root. See Setting Your Initial Working Folder.
Real-Time Workshop Build folder — The Real-Time Workshop C code files (model.c, model.h) are in a subfolder called modelname_xpc_rtw.
The xPC Target software uses the directories and files located in matlabroot\toolbox\rtw\targets\xpc\
target — Files and functions related to the xPC Target kernel and build process, including drivers to support I/O blocks
xpc — Host PC functions related to all of the xPC Target software, methods for target objects, and methods for scope objects
xpcdemos — Simulink models and M-file demos
You should set your MATLAB working folder outside the MATLAB root folder. The default MATLAB root folder is c:\matlab.
If your MATLAB working folder is below or inside the MATLAB root, files created by Simulink and Real-Time Workshop are mixed with the MATLAB directories. This mixing of files could cause file management problems.
Your initial working folder is specified in the shortcut file you use to start MATLAB. To change this initial folder, use the following procedure:
Right-click the MATLAB desktop icon or, from the program menu, right-click the MATLAB shortcut.
Click Properties. In the Start in text box, enter the folder path you want MATLAB to use initially. Make sure you choose a folder outside the MATLAB root folder.
Click OK, and then start MATLAB. To check your working folder, in the MATLAB Command Window, type
pwd
To temporarily set your MATLAB working folder, use the following procedure:
In the MATLAB Command Window, type
cd c:\<MATLAB working folder>
To check your working folder, type
pwd or cd
To permanently set your working folder, see From the Desktop Icon.
If you are running MATLAB remotely (accessing MATLAB over the network), register Active X controls before you start xPC Target Explorer.
In the MATLAB Command Window, type
xpc_register_ocx
This function registers the Active X controllers that xPC Target Explorer requires.
You are now ready to start xPC Target Explorer.
To configure the host PC for your compiler, use xPC Target Explorer.
If xPC Target Explorer is not already open, in the MATLAB Command Window, type
xpcexplr
The xPC Target Explorer window appears.

xPC Target Explorer always has a default target PC node in its configuration. The default target PC node is always boldfaced. In a multitarget environment, this visual aid helps you easily identify the default target PC.
In the xPC Target Explorer window, select the Compiler(s) Configuration node.
In the right pane, the compiler parameters appear.
At the Select C Compiler drop-down list, select the compiler you have installed on the host PC. The examples in this chapter use VisualC.
Enter the path (or browse) to the compiler for Compiler Path. For example,
C:\Application\Microsoft Visual Studio

Note xPC Target Explorer dialogs highlight a field and enable the Revert and Apply buttons when you make changes. To apply changes, click Apply. A prompt is displayed if you leave a dialog without first saving changes. If you want the original entry to be displayed, click the Revert button and do not click the Apply button. If you click Apply, you cannot retrieve the original entries. |
![]() | System Requirements | xPC Target Explorer | ![]() |

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 |