| Version 5.0 (R2007b) Real-Time Workshop® Embedded Coder™ Software Release Notes | ![]() |
This table summarizes what's new in Version 5.0 (R2007b):
| New Features and Changes | Version Compatibility Considerations | Fixed Bugs and Known Problems | Related Documentation at Web Site |
|---|---|---|---|
| Yes Details below | No | Bug
Reports Includes fixes | No |
New features and changes introduced in this version are
Elimination of Wrapper Generated by R2007a model_step Function Prototype Control Feature
Optimized External I/O Data Structures with Function Prototype Control
User-Defined Data Classes Can Reference Custom Storage Classes from Other Packages
In previous releases, the Target floating-point math environment parameter on the Interface pane of the Configuration Parameters dialog box allowed you to select a math library (ANSI, ISO, or GNU) to which function calls would be generated for appropriate/supported functions within the generated code for your model. However, no general mechanism was provided for creating and registering generic target-specific function libraries.
This release provides the target function library (TFL) API, which allows you to create and register function replacement tables. When selected for a model, these TFL tables provide the basis for replacing default math functions and operators in your model code with target-specific code. The ability to control function and operator replacements in this manner potentially allows you to optimize target performance (speed and memory) and better integrate model code with external and legacy code.
The general steps for creating and using a target function library are as follows:
Create one or more TFL tables containing replacement entries for math operators (+, –, *, /) and functions using a MATLAB-based API. (The demo rtwdemo_tfl_script provides example tables that can be used as a starting point for customization.)

Register a target function library, consisting of one or more replacement tables, using a Simulink sl_customization API.
Open your model and select the desired target function library from the Target function library drop-down list, located on the Interface pane in the Configuration Parameters dialog box.

Build your model.
For more information, see Target Function Libraries in the Real-Time Workshop® Embedded Coder™ documentation.
Additionally, see the new demo rtwdemo_tfl_script, which illustrates how to use TFLs to replace operators and functions in generated code. With each example model included in this demo, a separate TFL is provided to illustrate the creation of operator and function replacements and how to register the replacements with Simulink.
In previous releases, Real-Time Workshop Embedded Coder software provided traceability from generated code back to model source blocks through the Include hyperlinks to model option on the Real-Time Workshop pane of the Configuration Parameters dialog box.
This release provides bidirectional traceability between model source blocks and generated code by
Renaming the existing option from Include hyperlinks to model to Code-to-block highlighting
Adding the Block-to-code highlighting option, which allows you to select a block and highlight its generated code.
To use Block-to-code highlighting,
Open an ERT-based model and go to the Real-Time Workshop pane of the Configuration Parameters dialog box. Select the options Generate HTML report, Launch report automatically, and Block-to-code highlighting. (Selecting Block-to-code highlighting also enables the Configure button, which you can click to select a build directory to be traced.)

Build your model. This will launch an HTML code generation report.
In the model window, right-click any block. In the right-click menu, select Real-Time Workshop > Highlight Code.

This selection highlights the generated code for the block in the HTML code generation report. The total number of highlighted lines is displayed next to each source file name in the left panel of the HTML report. Previous and Next buttons help you navigate through the highlighted lines.

For more information, see Creating and Using a Code Generation Report in the Real-Time Workshop Embedded Coder documentation.
Additionally, see the enhanced demo rtwdemo_hyperlinks, which walks you through using Code-to-block highlighting, Block-to-code highlighting, and the traceability report discussed in the next section.
In previous releases, HTML code generation reports did not provide information to help explain why some model blocks do not generate corresponding code. In this release, when you select the Block-to-code highlighting parameter discussed in the previous section, the generated HTML report contains a traceability report. The traceability report contains sections that allow you to account for Eliminated / Virtual Blocks versus Traceable Blocks, providing a complete mapping between blocks and code.

For more information, see Creating and Using a Code Generation Report in the Real-Time Workshop Embedded Coder documentation.
Additionally, see the enhanced demo rtwdemo_hyperlinks, which walks you through using the new traceability report.
In R2007a, function prototype control generated a wrapper function to implement the model_step function. In R2007b, function prototype control modifies the model_step function directly, reducing execution time.
In R2007b, function prototype control optimizes external I/O data structures in the following ways:
The data structure of a model's external input is removed unless the value of the external input is used in a subsystem implemented by a nonreusable function.
The data structure for the model's external output is removed except when MAT-file logging is enabled, or if the sample time of the outport is constant.
For more information, see Controlling model_step Function Prototypes in the Real-Time Workshop Embedded Coder documentation.
R2007b improves MISRA-C compliance of generated code by:
Implementing enabled subsystem logic more efficiently using if-then-else statements
Improving compliance of library code used in generated code
In previous releases, the custom storage classes and memory section definitions contained in a package were unique to that package, and could not be used directly by other packages. The only recourse was to create a duplicate definition in every package that needed it. If a global change was needed in the definition of the class or section, each local copy had to be updated separately.
Any package can access and use custom storage classes and memory sections that are defined in any other package, including both user-defined packages and predefined packages such as Simulink and mpt. Only one copy of the class or section exists, in the package that first defined it; other packages refer to it by pointing to it in its original location. Thus any changes to the class or section, including changes to a predefined class/section in later MathWorks product releases, are available in every referencing package.
To configure a package to use a custom storage class or memory section that is defined in another package:
Type cscdesigner to launch the Custom Storage Class Designer. The relevant part of the designer window looks like this:

Select the Custom Storage Class or Memory Section tab as appropriate. Th following example assumes Custom Storage Class. Memory section references work the same way.
Use Select Package to select the package in which you want to reference a class (or section) defined in some other package.
In the Custom storage class definitions pane, select the existing definition below which you want to insert the reference.
Click New Reference.
A new reference with a default name and properties appears below the previously selected definition. The new reference is selected, and a Reference tab appears that shows the reference's initial properties. This tab appears whenever a reference is selected, allowing reference properties to be viewed and changed. A typical appearance is:

Use the Name field to enter a name for the new reference. The name must be unique in the importing package, but can duplicate the name in the source package.
Set Refer to custom storage class in package to specify the package that contains the custom storage class you want to reference.
Set Custom storage class to reference to specify the custom storage class to be referenced. Trying to create a circular reference generates an error and leaves the package unchanged.
Click OK or Apply.
If you had worked under the Memory Section tab rather than the Custom Storage Class tab, the sequence would have been essentially the same, with appropriate differences in the dialog box labels and the set of items available to be chosen.
You can use Custom Storage Class Designer capabilities to copy, reorder, validate, and otherwise manage classes and sections that have been added to a class by reference. However, you cannot change the underlying definitions. You can change a custom storage class or memory section only in the package where it was originally defined.
For more information, see Using Custom Storage Class References and Using Memory Section References.
Simulink now provides a standardized user interface, the Data Type Assistant, for specifying data types associated with Simulink blocks and data objects, as well as Stateflow data. See Using the Data Type Assistant for details.
The Data Type Assistant appears on the dialogs of a variety of blocks and data objects, including MPT data objects, which are specific to the Real-Time Workshop Embedded Coder software:
mpt.Parameter
mpt.Signal
Information about MPT objects appears in Real-Time Workshop® Embedded Coder™ Module Packaging Features.
V5.0 (R2007b) Real-Time Workshop Embedded Coder introduces a new target configuration parameter, CompOptLevelCompliant. This parameter indicates whether a target supports the new Real-Time Workshop configuration parameter Compiler Optimization Level. (Compiler Optimization Level controls the compiler optimization level for building generated code; for more information, see Controlling Compiler Optimization Level and Specifying Custom Optimization Settings in the Real-Time Workshop documentation.)
When the CompOptLevelCompliant target configuration parameter is set to on, the Compiler Optimization Level parameter is displayed in the Real-Time Workshop pane of the Configuration Parameters dialog box for your model. If the CompOptLevelCompliant parameter is not set to on, the Compiler Optimization Level parameter does not appear.
By default, the CompOptLevelCompliant parameter is set to off for custom targets and on for targets provided by Real-Time Workshop and Real-Time Workshop Embedded Coder.
To make a target compliant, use the SelectCallback function to set CompOptLevelCompliant to on, and then modify the target makefile to honor the setting for Compiler Optimization Level, in the manner of the targets provided by Real-Time Workshop and Real-Time Workshop Embedded Coder.
An interactive demo of Real-Time Workshop Embedded Coder is available. This demo shows you how to apply MathWorks products to the basic steps that are common to most projects that design and implement a control algorithm. To view the demo:
Launch MATLAB Online Help.
Configure File > Preferences > Help > Enable product filter so that Help information appears for Simulink, Real-Time Workshop, and Real-Time Workshop Embedded Coder.
Select the Demos tab.
Navigate to and expand Simulink > Real-Time Workshop > Guided Introductions > Real-Time Workshop Embedded Coder.
Help displays the names of the modules that comprise the Real-Time Workshop Embedded Coder Guided Introduction. To begin viewing the demo, click the name of the first module, Introduction, then proceed through subsequent modules in order, or jump directly to any that are of particular interest.
The following demos have been added:
| Demo... | Shows How You Can... |
|---|---|
| rtwdemo_pcgd_intro | Apply MathWorks products to the basic steps that are common to most projects that design and implement a control algorithm. For more information, see New Interactive Guided Introduction Demo. |
| rtwdemo_tfl_script | Use Target Function Libraries (TFLs) to replace operators and functions in generated code. With each example model included in this demo, a separate Target Function Library is provided to illustrate the creation of operator and function replacements using a MATLAB based API, and how to register the replacements with Simulink. |
The following demo has been enhanced to illustrate code traceability improvements in R2007b, including block-to-code highlighting and traceability report enhancements:
![]() | Version 5.1 (R2008a) Real-Time Workshop® Embedded Coder™ Software | Version 4.6.1 (R2007a+) Real-Time Workshop® Embedded Coder™ Software | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |