Real-Time Workshop | ![]() ![]() |
Introduction
The Real-Time Workshop rapid simulation target (rsim) consists of a set of target files for nonreal-time execution on your host computer. You can use rsim to generate fast, stand-alone simulations that allow batch parameter tuning and loading of new simulation data (signals) from a standard MATLAB MAT-file without needing to recompile your model.
The C code generated from Real-Time Workshop is highly optimized to provide fast execution of Simulink models of hybrid, dynamic systems. This includes models using variable step solvers and zero crossing detection.
The speed of the generated code makes the rsim target ideal for batch or Monte Carlo simulation. The generated executable (model.
exe
) created using the rsim target has the necessary run-time interface to read and write data to standard MATLAB MAT-files. Using this interface model.
exe
can reads new signals and parameters from input MAT-files at the start of the simulation and write the simulation results to output MAT-files.
Having built an rsim executable with Real-Time Workshop and an appropriate C compiler for your host computer, you can perform any combination of the following by using command line options. Without recompiling, the rapid simulation target allows you to:
double
, float
, int32
, uint32
, int16
, uint16
, int8
, uint8
, and complex data types) by using the From Workspace block
file used to save model output data
Therefore, you can easily write simple scripts that will run a set of simulations in sequence while using new data sets. These scripts can be written to provide unique filenames for both input parameters and input signals, as well as output filenames for the entire model or for To File blocks.
The rsim target can be configured to either access all solvers available with Simulink (which is the default configuration) or use only the fixed step solvers packaged with Real-Time Workshop.
In the default configuration, the standalone executable (model.
exe
) created by the rsim target links with the Simulink solver module (a shared library) if the model uses a variable-step solver. When model.
exe
uses the Simulink solver module, running model.
exe
will check out a Simulink license (see details below). In such cases, model.
exe
requires read access to installed location of MATLAB and Simulink in order to locate the license.dat
file and the shared libraries.
![]() | Real-Time Workshop Rapid Simulation Target | Licensing Protocols for Simulink Solvers in Executables | ![]() |