Real-Time Workshop User's Guide    

Introduction

The Real-Time Workshop generates two styles of code. One code style is suitable for rapid prototyping (and simulation via code generation). The other style is suitable for embedded applications. This chapter discusses the program architecture, that is, the structure of the Real-Time Workshop generated code, associated with these two styles of code. The table below classifies the targets shipped with the Real-Time Workshop.

Table 6-1: Code Styles Listed By Target  
Target
Code Style (using C unless noted)
Real-Time Workshop Embedded Coder target
Embedded -- useful as a starting point when using the generated C code in an embedded application.
Generic real-time (GRT) target
Rapid prototyping -- nonreal-time simulation on your workstation. Useful as a starting point for creating a rapid prototyping real-time target that does not use real-time operating system tasking primitives. Also useful for validating the generated code on your workstation.
Real-time malloc target
Rapid prototyping -- very similar to the generic real-time (GRT) target except that this target allocates all model working memory dynamically rather than statically declaring it in advance.
Rapid simulation target
Rapid prototyping -- nonreal-time simulation of your model on your workstation. Useful as a high-speed or batch simulation tool.
S-function target
Rapid prototyping -- creates a C-MEX S-function for simulation of your model within another Simulink model.
Tornado (VxWorks) real-time target
Rapid prototyping -- runs model in real time using the VxWorks real-time operating system tasking primitives. Also useful as a starting point for targeting a real-time operating system.
Real-Time Windows target
Rapid prototyping -- runs model in real-time at interrupt level while your PC is running Microsoft Windows in the background.
Ada simulation target
Embedded -- nonreal-time simulation on your workstation using Ada. Useful for validating the generated code on your workstation.
Ada multitasking real-time target
Embedded -- uses Ada tasking primitives to run your model in real time. Useful as a starting point when using the generated Ada code in an embedded application.
xPC target
Rapid prototyping -- runs model in real time on target PC running xPC kernel.
DOS real-time target
Rapid prototyping -- runs model in real time at interrupt level under DOS.

Third-party vendors supply additional targets for the Real-Time Workshop. Generally, these can be classified as rapid prototyping targets. For more information about third-party products, see the MATLAB Connections Web page: http://www.mathworks.com/products/connections.

You can identify the rapid prototyping style of generated code by its use of the SimStruct data structure (i.e., #include "simstruc.h"). In contrast, the embedded code style does not have a SimStruct.

This chapter is divided into three sections. The first section discusses model execution; the second section discusses the rapid prototyping style of code; and the third section discusses the embedded style of code.


 Program Architecture Model Execution