User`s guide
Open Architecture of the Real-Time Workshop
1-17
A First Look at Real-Time Workshop Files
An example of a Simulink model is this block diagram:
Figure 1-4: A Simple Simulink Model
This model is saved in a file called example.mdl. Generating C code from
example.mdl is done by using the Real-Time Workshop user interface for
generating code and executables. The next chapter, “Getting Started with the
Real-Time Workshop,” explains the details of the user interface.
Later in this section are excerpts from the associated
.rtw files that the
Real-Time Workshop uses to generate the real-time version of this model in C.
Basic Features of example.rtw
When you invoke the Real-Time Workshop build procedure to generate code, it
first compiles your model. This compilation process consists of these tasks:
• Evaluating simulation and block parameters
• Propagating signal width and sample times
• Computing work vector sizes such as those used by S-functions (for more
information about work vectors, refer to the Simulink documentation)
• Determining the execution order of blocks within the model
The Real-Time Workshop writes this information out to
example.rtw.The
example.rtw file is an ASCII file consisting of parameter value pairs stored in
a hierarchical structure consisting of records. Below is an excerpt from
1
Out
Sine Wave
1
Gain
sin_out gain_out