User`s guide

1 Introduction to the Real-Time Workshop
1-4
High-speed stand-alone simulations.
Generation of portable C code for export to other simulation programs.
The Generated Code
The generated code (i.e., the model code) is by default highly optimized and
fully commented C code that can be generated from any Simulink model,
including linear, nonlinear, continuous, discrete, or hybrid models.
All Simulink blocks are automatically converted to code, with the exception of
MATLAB function blocks and S-function blocks that invoke M-files. You must
rewrite these blocks as C MEX S-functions if you want to use them with the
Real-Time Workshop.
The Real-Time Workshop includes a set of target files that are compiled by the
Target Language Compiler (TLC) to produce ANSI C code. The target files are
ASCII text files that describe how to convert the Simulink model to code. For
advanced users, target files enable you to customize generated code for
individual blocks or throughout the entire model. See the Target Language
Compiler Reference Guide for more information about customizing target files.
You can incorporate C MEX S-functions, along with the generated code, into
the program executable. You can also write a target file for your C MEX
S-function to inline the S-function, thus improving performance by eliminating
function calls to the S-function itself.
Types of Output
The Real-Time Workshop’s interface allows you to select various types of
output:
C code — Generate code that contains system equations and initialization
functions for the Simulink model. You can use this code in nonreal-time
simulation environments or for real-time applications.
Ada code — Generate Ada code from your Simulink model. This option
requires that you have installed the Real-Time Workshop Ada Coder, which
is a separate product. See Chapter 14, “Real-Time Workshop Ada Coder,” for
more information.
A real-time program — Transform the generated code into a real-time
program suitable for use with dedicated real-time hardware. The resulting
code is designed to interface with an external clock source and hence runs at