
12
Figure 4: RTW EC - non-reusable code options for release 2007a
3.2.4 Simulation Using the Generated Code
To compare between a fixed-point simulation and a simulation with the generated
code an S-function of the generated code can be obtained by simply selecting an
option to generate an S-function in the code generation pane. The user can test the
behaviour of the generated code by replacing the original fixed-point model
reference with the generated S-function block.
3.2.5 External Function Calls and S-function Support
Replacing a hardware invocation with another function during simulation stage is
not always practical when generating code with Real-Time Workshop Embedded
Coder due to the difficulties of shaping the interface of the code. Here the only
way to achieve the desired result is to use so called Legacy Code. Legacy code
helps integrate external code into the model. In this project an S-function is
generated and added to the model. Legacy code is then used so that the S-function
block is replaced by the desired hardware function call in the generated code.
However legacy code can not be used with reusable code unless the option
SS_OPTION_WORKS_WITH_CODE_REUSE is set in the S-function.
Kommentare zu diesen Handbüchern