| 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 xPC Target software does not require Microsoft DOS, Microsoft Windows®, Linux®, or any another operating system on the target PC. Instead, you boot the target PC with a boot disk that includes the xPC Target kernel.
However, the xPC Target Embedded Option product requires DOS and a DOS license at boot time. For more information, see Embedded Option in the xPC Target User's Guide.
The boot disk eliminates the need to install software, modify existing software configurations, or access the hard disk on the target PC. This arrangement allows you to use the target PC for testing real-time applications, and then when you are finished with your tests, you can use the target PC again as a desktop computer. Software is not permanently installed on the target PC unless you deliberately install a stand-alone application on the hard disk or flash memory using the xPC Target Embedded Option software. A target boot disk can be either a CD or a 3.5-inch floppy disk. Note you can also boot a target PC from a boot image across a dedicated network.
Selecting a current BIOS allows you to customize settings for better control over the real-time behavior of the system. For example, you can suppress checking for a keyboard and switch off any power save features.
The xPC Target kernel runs only on a PC-compatible system, and a key component of every PC-compatible system is the BIOS. The BIOS is the only software component that is needed by the xPC Target kernel.
After the BIOS is loaded, it searches the target boot disk or dedicated network for a bootable image (executable). This bootable image includes a 16-bit part and a 32-bit part. The 16-bit part runs first because the CPU is still in real mode. It prepares the descriptor tables and, in addition to other things, switches the CPU to protected mode. Next, the 32-bit part runs. It prepares the target PC environment for running the kernel and finally starts the kernel.
After loading the kernel, the target PC does not make calls to the BIOS or DOS functions. The resources on the CPU motherboard (for example, interrupt controller, UART, and counters) are addressed entirely through I/O addresses.
After the kernel starts running, it displays a welcome message with information about the host-target connection. The kernel activates the application loader and waits to download a target application from the host PC. The loader receives the code, copies the different code sections to their designated addresses, and sets the target application ready to start. You can now use xPC Target functions and other utilities to communicate with the target application.
It is important to note that after the CPU switches to protected mode (32-bit), none of the xPC Target components switches the CPU back to real mode (16-bit).
The generated real-time application and the real-time kernel are compiled as Microsoft Windows NT® applications with a flat memory model. This provides full 32-bit power without time-consuming 16-bit segment switching and Microsoft DOS extenders.
The Real-Time Workshop, Real-Time Workshop Embedded Coder, Stateflow Coder, and xPC Target products, and a C compiler, create a real-time application (target application) from a Simulink and Stateflow model. Target applications created with the Real-Time Workshop and xPC Target software run in real time on a standard PC without using a Windows operating system.
The target application runs in real time on the target PC and has the following characteristics:
Memory model — The target application is compiled as a Windows NT application with the flat memory model. This executable is then converted to an image suitable for the xPC Target software, and it provides full 32-bit power without time-consuming 16-bit segment switching and DOS extenders. It also does not rely on DOS or any other Microsoft operating system.
Task execution time — The target application is capable of high-speed, real-time task execution. A small block diagram can run with a sample time as fast as 20 µs (50 kHz). Model size, complexity, and target PC hardware affect maximum speed (minimal sample time) of execution.
For more information on creating a target application, see xPC Target Application.
The xPC Target real-time kernel stores signal data from the target application in RAM on the target PC. Alternatively, you can have the xPC Target real-time kernel store signal data in a file on the target PC. In either case, you can use this signal data to analyze and visualize signals. The xPC Target product supports the following types of signal acquisition:
Signal monitoring — This is the process of acquiring signal data without time information. In this mode, you can get the current values of one or more signals. The data is not acquired in the real-time task but in the background task. The advantage of this process is that collecting data does not add any computational load to running the real-time application.
For example, if you have a LED gauge in a Simulink model on the host PC, you could use signal monitoring to display the status of the signal.
Signal logging — This is the process of acquiring signal data while a target application is running, and then visualizing the collected data after the target application stops running. The data is collected in the real-time task and acquired samples are associated with a time stamp. After the run finishes or you manually stop the run, the host PC makes a request to upload data from the target PC. You can then visualize signals by plotting data on the host PC, or you can save data to a disk.
Signal tracing — This is the process of acquiring and visualizing signal data while a target application is running. The data is collected in the real-time task and acquired samples are associated with a time stamp. It allows you to acquire signal data and visualize it on the target PC or to upload the signal data and visualize it on the host PC while the target application is running. The flexibility of this acquisition type is very similar to the behavior of a digital oscilloscope.
You can use the xPC Target software to acquire and log signals of the following data types:
double
single
uint8/int8
uint16/int16
uint32/int32
The xPC Target software also allows you to monitor and tune signal and parameter values represented by fixed-point numbers.
The xPC Target software also supports the acquisition of multidimensional signals.
For information on acquiring signal data with the xPC Target software, see User Interaction in the xPC Target Getting Started Guide and Signal Monitoring with the MATLAB Interface, Signal Logging and Signal Tracing in the xPC Target User's Guide documentation.
Most Simulink blocks have parameters (such as the amplitude and frequency of a sine wave) that you can change before or while your target application is running:
Interactive — The xPC Target software supports tuning of parameters while the target application is running in real time.
Scripts and batch procedures — The xPC Target software also includes commands to change parameters during a run or between runs. By writing a script that incrementally changes a parameter and monitors a signal output and running it on the host PC, you can optimize the value of that parameter.
You can use the xPC Target software to tune parameters of the following data types:
double
single
uint8/int8
uint16/int16
uint32/int32
The xPC Target software also supports the tuning of multidimensional parameters.
For information on tuning parameters with the xPC Target software, see User Interaction and Parameter Tuning and Inlining Parameters in the xPC Target User's Guide.
The xPC Target software supports Simulink fixed-point data. This enables you to
Monitor and log signals of fixed-point data types
Tune parameters of fixed-point data types
For more information on using fixed-point data, see the Simulink Fixed Point.
The xPC Target software supports the MATLAB® Compiler™. With this capability, you can use the MATLAB Compiler to take M-files as input and generate redistributable, stand-alone applications that include xPC Target functionality.
Stand-alone applications that include xPC Target functionality have the following limitations:
No MATLAB Compiler support, which results in no access to the xPC Target library (xpclib).
No xPC Target Explorer, or other xPC Target graphical user interface support.
No code generation functionality.
To use these features, write an M-file that uses the MATLAB Compiler command-line interface for the xPC Target software (for example, then use the MATLAB Compiler).
![]() | Expected Background | Hardware Environment | ![]() |

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 |