Real-Time Workshop User's Guide | ![]() ![]() |
Rapid Prototyping and Embedded
Model Execution Differences
The rapid prototyping program framework provides a common application programming interface (API) that does not change between model definitions.
The Real-Time Workshop Embedded Coder provides a different framework that we will refer to as the embedded program framework. The embedded program framework provides a optimized API that is tailored to your model. It is intended that when you use the embedded style of generated code, you are modeling how you would like your code to execute in your embedded system. Therefore, the definitions defined in your model should be specific to your embedded targets. Items such as the model name, parameter, and signal storage class are included as part of the API for the embedded style of code.
The single largest difference between the rapid prototyping and embedded style of generated code is that the embedded code does not contain the SimStruct
data structure. The SimStruct
defines a common API that the rapid prototyping style of generated code relies heavily on. However, the SimStruct
data structure supports many options and therefore consumes memory that is not needed in an embedded application.
Another major difference between the rapid prototyping and embedded style of generated code is that the latter contains fewer entry-point functions. The embedded style of code can be configured to have only one run-time function model
_step
. You can define a single run-time function because the embedded target:
SimStruct
data structureThus, when looking at the model execution pseudocode presented earlier in this chapter, you can eliminate the Loop...EndLoop
statements, and group the ModelOutputs
, LogTXY
, and ModelUpdate
into a single statement, model
_step
.
For a detailed discussion of how generated embedded code executes, see Program Execution.
![]() | Data Logging In Single- and Multitasking Model Execution | Rapid Prototyping Model Functions | ![]() |