Version 4.1 (R12.1) Real-Time Workshop® Software

This table summarizes what's new in V4.1 (R12.1):

New Features and ChangesVersion Compatibility ConsiderationsFixed Bugs and Known ProblemsRelated Documentation at Web Site
Yes
Details below
Yes—Details labeled as Compatibility Considerations, below. See also Summary.Fixed bugsNo

New features and changes introduced in this version are

Block Reduction Option On by Default

The Block reduction option on the Advanced pane of the Simulation Parameters dialog box is now turned on by default.

Block reduction collapses certain groups of blocks into a single, more efficient block, or removes them entirely. This results in faster model execution during simulation and in generated code.

See Reducing the Number of Blocks in a Model in the Real-Time Workshop documentation for more information.

Compatibility Considerations

In previous releases, the Block reduction option on the Advanced pane of the Simulation Parameters dialog box was off by default. This option is now on by default.

Buffer Reuse Code Generation Option

A Buffer reuse option has been added to the Real-Time Workshop pane of the Simulation Parameters dialog box. When you select this option, the Real-Time Workshop software reuses signal storage whenever possible.

See Reusing Memory Allocated for Signals in the Real-Time Workshop documentation for more information.

Compatibility Considerations

In previous releases, the buffer reuse option was available only through MATLAB® set_param and get_param commands, such as:

set_param(gcs,'bufferreuse','on')

The ability to set and get this option with the set_param and get_param commands is still supported.

Build Directory Validation

The build process now disallows building programs in the MATLAB directory tree.

Compatibility Consideration

Prior to this release, the Real-Time Workshop software allowed you to build programs in the MATLAB directory tree. As of V4.1 (Release 12.1), this is no longer allowed. If you attempt to generate code in the MATLAB directory tree, the Real-Time Workshop software displays an error message, prompting you to change to a working directory that is not in the MATLAB directory tree. On a PC, you can continue to build in the directory matlabroot/Work.

The build process also prevents building programs when matlabroot has a dollar sign ($) in its MATLAB directory name.

Build Subsystem Enhancements

The Build Subsystem feature, introduced in the Real-Time Workshop software V4.0 (R12), lets you generate code and build an executable from any nonvirtual subsystem within a model. In the Real-Time Workshop software V4.1 (R12.1), the Build Subsystem feature has been enhanced as follows:

See Generating Code and Executables from Subsystems in the Real-Time Workshop documentation for more information.

C API for Parameter Tuning Documented

The Real-Time Workshop software provides data structures and a C API that enable a running program to access model parameters without use of external mode.

To access model parameters via the C API, you generate a model-specific parameter mapping file, model_pt.c. This file contains parameter mapping arrays that contain information required for parameter tuning.

See C-API for Interfacing with Signals and Parameters in the Real-Time Workshop documentation for information on how to generate and use the parameter mapping file.

Code Readability Improvements

Improvements to the readability of generated code include:

Support for Control Flow Blocks

Simulink® V4.1 (R12.1) implements a number of blocks that support logic constructs such as if-else and switch, and looping constructs such as do-while, for, and while. The Real-Time Workshop software V4.1 (R12.1) introduces code generation support for these blocks.

For more information on the control flow blocks, see Modeling Control Flow Logic in the Simulink documentation.

Expression Folding

Expression folding is a code optimization technique that minimizes the computation of intermediate results at block outputs, and the storage of such results in temporary buffers or variables. Wherever possible, the Real-Time Workshop software collapses, or "folds," block computations into single expressions, instead of generating separate code statements and storage declarations for each block in the model.

Expression folding dramatically improves the efficiency of generated code, frequently achieving results that compare favorably to hand-optimized code. In many cases, model computations fold into a single highly optimized line of code.

Most Simulink blocks support expression folding.

For more information, see Minimizing Computations and Storage for Intermediate Results in the Real-Time Workshop documentation.

External Mode Enhancements

Generate Comments Option

A new Comments option has been added to the Real-Time Workshop pane of the Simulation Parameters dialog box. This option lets you control whether or not comments are written in the generated code. See Configuring Code Comments in the Real-Time Workshop documentation for more information.

Include System Hierarchy in Identifiers Option

A new Include system hierarchy in identifiers option has been added to the Real-Time Workshop pane of the Simulation Parameters dialog box. When you select this option, the Real-Time Workshop software inserts system identification tags in the generated code (in addition to tags included in comments). The tags help you to identify the nesting level, within your source model, of the block that generated a given line of code.

See How Symbols Are Formatted in Generated Code in the Real-Time Workshop documentation for more information.

Rapid Simulation Target Support for Inline Parameters

The Rapid Simulation (RSim) Target now works with Inline parameters on. Note that when Inline parameters is on, the storage class for all parameters and signals is silently forced to auto.

S-Function Target Enhancements

The S-Function Target Generate S-function feature, introduced in the Real-Time Workshop software V4.0 (R12), lets you generate an S-function from a subsystem. This feature has been enhanced as follows:

See Automated S-Function Generation in the Real-Time Workshop documentation for details.

Storage Classes for Block States

For certain block types, the Real-Time Workshop software lets you control how block states in your model are stored and represented in the generated code. Using the State Properties dialog, you can:

For more information, see Block State Storage and Interfacing in the Real-Time Workshop documentation.

Support for tilde (~) in Filenames on UNIX® Platforms

All filename fields in Simulink now support the mapping of the tilde (~) character in filenames. For example, in a To File block you can specify <code>~/outdir/file.mat</code>. On most systems, this expands to /home/$USER/outdir/file.mat. The Real-Time Workshop software uses the expanded names.

Target Language Compiler Enhancements

This section summarizes Target Language Compiler enhancements.

Compatibility Considerations

RTWInfo Property Changed

Changes have been made to the RTWInfo property of Simulink.Signal and Simulink.Parameter data objects.

Compatibility Considerations

In V4.0 (R12), the RTWInfo class had a TypeQualifier property, corresponding to the RTW storage type qualifier field of signal ports and parameters.

The Real-Time Workshop software V4.1 (R12.1) now supports creation of custom storage classes, removing the need for the TypeQualifier property. You should use custom storage classes when type qualification is needed.

By default, the TypeQualifier property of RTWInfo objects is no longer visible in the Simulink Data Explorer. Also, the TypeQualifier property is no longer written to ObjectProperties records in the model.rtw file. For backward compatibility, the TypeQualifier property remains active. You can set and retrieve the property through a direct reference. For example,

Kp.RTWInfo.TypeQualifier = 'const'

or

tq = Kp.RTWInfo.TypeQualifier

You can make the TypeQualifier property visible in the Simulink Data Explorer for the duration of a MATLAB session. To do this, execute the following command prior to opening the Simulink Data Explorer,

feature('RTWInfoTypeQualifier',1)

The above command also directs the Real-Time Workshop software to include the TypeQualifier property in ObjectProperties records in the model.rtw file.

For more information see Simulink® Data Objects and Code Generation in the Real-Time Workshop documentation.

Fixed Bugs

The Real-Time Workshop software V4.1 (R12) includes the following bug fixes.

Block Reduction Crash Fixed

A problem that crashed MATLAB due to a segmentation fault during the block reduction process has been fixed. This problem occurred only if the Block Reduction option was on, and if a Scope block was connected to a block that was removed due to block reduction.

Build Subsystem Gives Better Error Message for Function Call Subsystems

The Build Subsystem feature does not currently support triggered function-call subsystems. The Real-Time Workshop software now gives a more informative error message when a Build Subsystem is attempted with a triggered function-call subsystem.

Check Consistency of Parameter Storage Class and Type Qualifier

The Real-Time Workshop software now checks for consistency of parameter storage class and type qualifier when a parameter is specified by both the Model Parameter Configuration dialog and a referenced Simulink data object.

Code Optimization for Unsigned Saturation and DeadZone Blocks

When the lower limit of a Saturation or DeadZone block is a zero and is nontunable, and the data type is unsigned, the comparison against the lower limit is omitted from the code. Similarly, if the upper or lower limit of the Saturation block is nontunable and nonfinite, the comparison against the infinite limit is omitted.

Correct Code Generation of Fixed-Point Blockset Blocks in DSP Blockset Models

A code generation bug involving some DSP Blockset blocks (see list below) was fixed. When these blocks were driven by a block from the Fixed-Point Blockset, generated code would write outside array memory bounds. The following DSP Blockset blocks generated incorrect code:

Delay Line
Frame Status Conversion
Matrix Multiply
Multiport Selector
Pad
Submatrix
Window Function
Zero Pad

Correct Compilation with Green Hills and DDI Compilers

Compilation errors for files associated with matrix inversion in the matlabroot/rtw/c/libsrc directory were fixed. These errors occurred with the Green Hills and DDI compilers.

Fixed Build Error with Models Having Names Identical to Windows NT® Commands

This fix prevents an error that occurred when building models having names identical to Windows NT® internal commands. Examples would be models named verify or path. Such model names are now allowed.

Fixed Error Copying Custom Code Blocks

An error in the Custom Code block Copyfcn callback was fixed. The problem caused an error when copying a custom code block within a model.

Fixed Error in commonmaplib.tlc

A typo in rev 1.17 of commonmap.tlc was fixed. This typo caused an error during code generation, when using the grt_malloc target with External mode selected.

Fixed Name Clashes with Run-Time Library Functions

The Real-Time Workshop software now uses the macros rt_min and rt_max to avoid clashing with run-time library min and max functions.

Improved Handling of Sample Times

The sample time handling for the S-function and ERT targets has been improved to use the compiled sample time instead of the user specified sample time on the input port blocks.

Look-Up Table (n-D) Code Generation Bug Fix

The Real-Time Workshop software now generates correct code for Look-Up Table (n-D) blocks having 5 or more dimensions with different dimension sizes.

Parenthesize Negative Numerics in Fcn Block Expressions

Fcn block expressions in the generated code failed to compile in the case of a unary operator preceding a workspace variable with a negative value, such as the expression

-v*u

Such expressions are now enclosed in parentheses, as in

(-v) * u

Unnecessary Warnings and Declarations Removed from Generated Code

Several unnecessary warnings and declarations in the generated code have been removed. These include:

Retain .rtw File Option Now Works in Accelerator Mode

In previous releases, the Retain .rtw file option (on the TLC Debugging Options page of the Simulation Parameters dialog) was ignored if Simulink was in Accelerator mode. Now, you can retain the model.rtw file during a build, regardless of the simulation mode.

S-Function Target Memory Allocation Bug Fix

A segmentation fault during generation of S-functions was removed by fixing the memory management of the port data structure.

TLC Bug Fixes

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS