xPC Target |
 |
Rapid Prototyping Process
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 interactive control of the target application, acquisition of signal data, and tuning of parameters while running in real time.
The rapid prototyping process includes the following sequence of tasks:
- Create a Simulink and 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.
- Because this computed time vector is not connected to a hardware clock, the outputs are calculated in nonreal time as fast as your computer can run. The time to run a simulation can differ significantly from real time.
- Create an executable target application -- Real-Time Workshop, Stateflow Coder, xPC Target, 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 that loads the xPC Target real-time kernel. After booting the target PC, you can build and download a real-time application.
- xPC Target provides the necessary software that makes use of real-time resources on the target PC hardware. Based on your selected sample rate, xPC Target uses interrupts to step the model at the proper rate. With each new interrupt, the target application computes all of the block outputs from your model.
- Acquire signals -- Acquire signal data using xPC Target Scopes. You can create xPC Target Scopes and acquire data from the target application by
- xPC Target -- Using the xPC Target Remote Control Tool and Scope Manager window to create scopes, and using the Simulink viewer to add signals.
- MATLAB -- Entering commands in the MATLAB window
- Simulink -- Adding xPC Target Scope blocks to your Simulink model
- Target PC -- Using commands in the target PC command window
- Web browser -- Using the xPC Target Web browser interface
- Simulink GUI -- Adding Gauge blocks from the Dials & Gauges blockset to a Simulink user interface model with xPC Target From blocks.
- Tune parameters -- You can tune parameters by
- xPC Target -- Using the xPC Target Remote Control Tool and Simulink viewer to change parameters
- MATLAB -- Entering commands in the MATLAB window
- Simulink -- Using your Simulink model with external mode
- Target PC -- Using commands in the target PC command window
- Web browser -- Using the xPC Target Web browser interface
- Simulink GUI -- Adding Dial blocks from the Dials & Gauges blockset to a Simulink user interface model with xPC Target To blocks.
| Host-Target Communication | | xPC Target Embedded Option |  |