Real-Time Workshop User's Guide | ![]() ![]() |
Open Architecture of the Real-Time Workshop
The Real-Time Workshop is an open system designed for use with a wide variety of operating environments and hardware types. There are many ways to modify and extend the key elements of Real-Time Workshop. Figure 2-3 shows these elements.
Figure 2-3: The Real-Time Workshop Architecture
You can configure the Real-Time Workshop program generation process to your own needs by modifying the following components:
model
.mdl
)Simulink provides a very high-level language (VHLL) development environment. The language elements are blocks and subsystems that visually embody your algorithms. You can think of the Real-Time Workshop as a compiler that processes a VHLL source program (model
.mdl
), and emits code suitable for a traditional high-level language (HLL) compiler.
S-functions written in C or Ada let you extend Simulink's VHLL by adding new general purpose blocks, or incorporating legacy code into a block.
model
.rtw
)The initial stage of the code generation process is to analyze the source model. The resultant description file contains a hierarchical structure of records describing systems and blocks and their connections.
The S-function API includes a special function, mdlRTW
, that lets you customize the code generation process by inserting parameter data from your own blocks into the model
.rtw
file.
The Target Language Compiler interprets a program that reads the intermediate model description and generates code that implements the model as a program.
You can customize the elements of the TLC program in two ways. First, you can implement your own system target file, which controls overall code generation parameters. Second, you can implement block target files, which control how code is generated from individual blocks such as your own S-function blocks.
There are several ways to customize generated code, or interface it to custom code:
The run-time interface consists of code interfacing to the generated model code. You can create a custom set of run-time interface files, including:
model
.mk
A makefile, model
.mk
, controls the compilation and linking of generated code. The Real-Time Workshop generates model
.mk
from a template makefile during the code generation/build process. You can create a custom template makefile to control compiler options and other variables of the make
process.
All of these components contribute to the process of transforming a Simulink model into an executable program. The next section is an overview of this process.
![]() | Rapid Prototyping for Control Systems | Automatic Program Building | ![]() |