| 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… |
|---|
The software environment is a place to design, build, and test a target application in nonreal time and real time. It also includes communication between the host and target computers.
Whether using a serial connection (RS-232) or a network connection (TCP/IP), information is exchanged between the host PC and target PC. This information includes
Target application — Download a target application from the host to the target computer.
Control — Change properties and control the target application. This includes starting and stopping the target application, changing sample and stop times, and getting information about the performance of the target application and CPU.
Signal data — Upload signal data from the target computer for analysis after the target application is finished running, or view signal data during the run.
Parameter values — Download parameter values to the target computer between runs or during a run.
Design and build a target application on a host PC, and then run and test the target application on a target PC. xPC Target functions include control of the target application, acquisition of signal data, and tuning of parameters while running in real time.
Note Opening a dialog box for a source block causes Simulink to pause. While Simulink is paused, you can edit the parameter values. You must close the dialog box to have the changes take effect and allow Simulink to continue. |
The rapid prototyping process includes the following tasks:
Create a Simulink or Stateflow model — You create block diagrams in Simulink using simple drag-and-drop operations, and then you enter values for the block parameters and select sample rates. If you use continuous-time components, you also need to select an integration algorithm.
Simulate the model in nonreal time — Simulink uses a computed time vector to step the model. After the outputs are computed for a given time value, Simulink immediately repeats the computations for the next time value. This process is repeated until it reaches the stop time.
Create an executable target application — The Real-Time Workshop, Stateflow Coder, xPC Target products, and a C compiler, create the target application that runs on the target PC. This real-time application uses the initial parameters from the Simulink model that were available at the time of code generation.
Execute the target application in real time — The target PC is booted using an xPC Target boot disk or network boot image that loads the xPC Target real-time kernel. After booting the target PC, you can build and download a real-time application.
The xPC Target software uses real-time resources on the target PC hardware. Based on your selected sample rate, the xPC Target software uses interrupts to step the model at the proper rate. With each new interrupt, the target application computes all the block outputs from your model.
Acquire signals — Acquire signal data using xPC Target scopes. xPC Target software supports 10 scopes for scopes of type target, 8 scopes of type file, and an infinite number of scopes of type host, as long as the target PC resources can support them.
Scopes created by xPC Target Scope blocks acquire data according to Simulink sample time rules. This includes non-regular execution, such as if the scope is in an enabled or triggered subsystem. Note that scopes created dynamically (from the MATLAB Command Window or the API) sample at the base rate, irrespective of the sample time of their signals.
You can create xPC Target scopes and acquire data from the target application by
xPC Target — Use the xPC Target Remote Control Tool and Scope Manager windows to create scopes, and use the Simulink viewer to add signals.
MATLAB — Enter commands in the MATLAB Command Window.
Simulink — Add xPC Target Scope blocks to your Simulink model.
Target PC — Use commands in the target PC command window.
Web browser — Use the xPC Target Web browser interface.
Simulink GUI — Add blocks to a Simulink user interface model with xPC Target From blocks. See Graphical User Interfaces in the xPC Target User's Guide documentation for details.
Tune parameters — You can tune parameters by
xPC Target GUI — Use the xPC Target Remote Control Tool and Simulink viewer to change parameters.
MATLAB interface — Enter commands in the MATLAB window.
Simulink interface —- Use your Simulink model with external mode.
Target PC — Use commands in the target PC command window.
Web browser — Use the xPC Target Web browser interface.
Simulink GUI —- Add blocks to a Simulink user interface model with xPC Target To blocks. See Graphical User Interfaces in the xPC Target User's Guide for details.
Often, control system and digital signal processing applications are developed for use in production where a limited number of deployed systems is required. Whether you deploy one or a hundred systems, the xPC Target Embedded Option software provides a convenient approach that allows you to implement your system on low-cost PC hardware.
When you have completed developing and testing, you can use the target application as a real-time system that runs on a dedicated target PC without needing to connect to the host computer.
The xPC Target Embedded Option product has one mode of operation, StandAlone. In this case, the target PC boots into the Microsoft DOS environment, starts the DOS program xpcboot.com from autoexec.bat, and then starts the kernel from xpcboot.com:
When using Boot Floppy or CD Boot, you do not need DOS environment to load and run the xPC Target kernel. DOSLoader mode, like StandAlone mode, boots the target PC into DOS, starts the DOS program xpcboot.com from autoexec.bat, and then starts the kernel from xpcboot.com.
Note The xPC Target Embedded Option software is a separate product that requires an additional license from The MathWorks. With this additional license you can deploy an unlimited number of real-time applications for stand-alone operation. |
For more information on the xPC Target Embedded Option product, see Embedded Option in the xPC Target User's Guide.
StandAlone mode combines the target application with the kernel and boots them together on the target PC from a hard disk drive or flash memory. The host PC does not have to be connected to the target PC.
Select StandAlone mode from the Configuration node in the xPC Target Hierarchy pane of the xPC Target Explorer tool.
Copy DOS system files, utilities, kernel/application files, and helper files to the target PC hard drive or flash memory.
Boot the target PC.
When you boot the target PC, the target PC loads DOS environment, which then calls the xPC Target autoexec.bat file to start the xPC Target kernel (*.rtb) and associated target application. If you set up the boot device to run the xPC Target autoexec.bat file upon startup, the target application starts executing as soon as possible. The xPC Target application executes entirely in protected mode using the 32-bit flat memory model.
For more information on the xPC Target Embedded Option product, see Embedded Option in the xPC Target User's Guide.
![]() | Hardware Environment | User Interaction | ![]() |

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 |