Skip to Main Content Skip to Search
Product Documentation

Software Environment

Non-Real-Time Simulation

You create a Simulink model and use Simulink software in normal mode for non-real-time simulation on your PC computer.

Simulink model — Create block diagrams with Simulink software by using simple drag-and-drop operations, and then enter values for the block parameters and select a sample rate.

Non-real-time simulation — Simulink software uses a computed time vector to step your Simulink model. After the outputs are computed for a given time value, the Simulink software 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.

Real-Time Execution

For real-time execution on your PC computer, create a real-time application and use Simulink external mode, Simulink Coder code generation software, Real-Time Windows Target software, and the Open Watcom C/C++ compiler, to produce an executable that the kernel can run in real time. This real-time application uses the initial parameters available from your Simulink model at the time of code generation.

If you use continuous-time components in your model and create code with Simulink Coder code generation software, you must use a fixed-step integration algorithm. Real-Time Windows Target software provides the capabilities necessary for using the real-time resources on your computer hardware. Based on your selected sample rate, Real-Time Windows Target software uses interrupts to step your application in real time at the proper rate. With each new interrupt, the executable computes all of the block outputs from your model.

Development Process

With Real-Time Windows Target rapid prototyping software, you can use your desktop PC with the MATLAB environment, Simulink software, Simulink Coder code generation software, and Real-Time Windows Target software to:

  1. Design a control system — Use the MATLAB environment and Control System Toolbox™ software to design and select the system coefficients for your controller.

  2. Create a Simulink model — Use Simulink blocks to graphically model your physical system.

  3. Run a simulation in nonreal time — Check the behavior of your model before you create a real-time application. For example, you can check the stability of your model.

  4. Create a real-time application — Simulink Coder code generation software creates C code from your Simulink model. The Open Watcom C/C++ compiler compiles the C code to an executable that runs with the Real-Time Windows Target kernel.

  5. Run an application in real time — Your desktop PC is the target computer to run the real-time application.

  6. Analyze and visualize signal data — Use MATLAB functions to plot data saved to the MATLAB workspace or a disk.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS