| Version 4.1 (R12.1) Real-Time Workshop® Software Release Notes | ![]() |
This table summarizes what's new in V4.1 (R12.1):
| New Features and Changes | Version Compatibility Considerations | Fixed Bugs and Known Problems | Related Documentation at Web Site |
|---|---|---|---|
| Yes Details below | Yes—Details labeled as Compatibility Considerations, below. See also Summary. | Fixed bugs | No |
New features and changes introduced in this version are
Note For information about closely related products that extend the Real-Time Workshop® product, see the Release Notes for those products. |
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.
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.
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.
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.
The build process now disallows building programs in the MATLAB directory tree.
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.
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:
The Build Subsystem window now displays additional information about block parameters referenced by the subsystem.
From the Build Subsystem window, you can now inline or set the storage class of any parameter.
See Generating Code and Executables from Subsystems in the Real-Time Workshop documentation for more information.
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.
Improvements to the readability of generated code include:
Elimination of redundant parentheses.
Long C statements in the generated code are now split across multiple lines.
Block comments are more informative.
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 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.
Support for inline parameters
The Real-Time Workshop software now lets you use the Inline parameters code generation option when building an external mode target program. When you inline parameters, you can use the Model Parameter Configuration dialog box to remove individual parameters from inlining and declare them to be tunable. This allows you to improve overall efficiency by inlining most parameters, while at the same time retaining the flexibility of runtime tuning for selected parameters that are important to your application. In addition, the Model Parameter Configuration dialog box offers you options for controlling how parameters are represented in the generated code.
Each time Simulink connects to a target program that was generated with Inline parameters on, the target program uploads the current value of its tunable parameters (if any) to the host. These values are assigned to the corresponding MATLAB workspace variables. This procedure ensures that the host and target are synchronized with respect to parameter values.
All targets that support external mode (that is, grt, grt_malloc, and Tornado) now allow inline parameters.
See External Mode Communications Overview in the Real-Time Workshop documentation for more information.
New status bar display
When Simulink is connected to a running external mode target program, the simulation time and other status bar information is now displayed and updated just as it would be in normal mode.
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.
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.
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.
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:
The Generate S-function window now displays additional information about block parameters referenced by the generating subsystem.
If you have installed and licensed the Real-Time Workshop® Embedded Coder™ product, the Generate S-function window lets you invoke the Real-Time Workshop Embedded Coder build process to generate an S-function wrapper.
See Automated S-Function Generation in the Real-Time Workshop documentation for details.
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:
Control whether or not states declared in generated code are interfaceable (visible) to externally written code. You can also specify that signals are to be stored in locations declared by externally written code.
Assign symbolic names to block states in generated code.
For more information, see Block State Storage and Interfacing in the Real-Time Workshop documentation.
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.
This section summarizes Target Language Compiler enhancements.
New TLC debugger added
The TLC debugger helps you identify programming errors in your TLC code. You can set breakpoints in your TLC code, execute TLC code line-by-line, examine and change variables, and perform many other useful operations.
The TLC debugger operates during code generation, incurring almost no overhead in the code generation process. You can invoke the debugger:
By selecting options in the TLC debugging options category of the Real-Time Workshop pane.
By including %breakpoint statements in your TLC file.
By using the MATLAB tlc command, as in
tlc -dc <options>
By using the -dc build option in the System target file field of the Real-Time Workshop pane.
For more information, see Debugging TLC Files in the Target Language Compiler documentation.
model.rtw file format changed
The format of the model.rtw file has changed.
Block I/O connection handling cleaned up
The handling of signal connections in rtw/c/tlc/blkiolib.tlc and rtw/ada/tlc/blkiolib.tlc has been reworked. See the description of LibBlockInputSignal in the Target Language Compiler documentation for details.
Support for literal string added
If a string constant is preceded by an L format specifier (as in L"string"), the Target Language Compiler performs no escape character processing on that string. This is useful for specifying PC-style paths without using double back slash characters.
%addincludepath L"C:\mytlc"
The following examples are equivalent.
L"d:\this\is\a\path"
"d:\\this\\is\\a\\path"
Library functions added
The following functions have been added to the TLC Function Library:
| LibBlockInputSignalConnected |
| LibBlockInputSignalLocalSampleTimeIndex |
| LibBlockInputSignalOffsetTime |
| LibBlockInputSignalSampleTime |
| LibBlockInputSignalSampleTimeIndex |
| LibBlockOutputSignalOffsetTime |
| LibBlockOutputSignalSampleTime |
| LibBlockOutputSignalSampleTimeIndex |
| LibBlockMatrixParameterBaseAddr |
| LibBlockParameterBaseAddr |
| LibBlockNonSampledZC |
See the Target Language Compiler documentation for information on these functions.
model.rtw file format has changed. For more information, see the Target Language Compiler documentation.
BlockTypeSetup and BlockInstanceSetup calls have been reordered. During the initialization phase of code generation, the Target Language Compiler makes a pass over all blocks in the model and executes several functions, including:
Each block's BlockTypeSetup function the first time that block type is encountered.
Each block's BlockInstanceSetup function. BlockInstanceSetup is called for all instances of a given block type in the model.
The order in which these calls are made is significant, because the BlockInstanceSetup function may depend upon global variables that are initialized by the BlockTypeSetup function.
In V4.1 (R12) , the BlockTypeSetup function is called before the BlockInstanceSetup. This corrects a problem in previous releases, where BlockInstanceSetup was erroneously called first. You may need to change your S-functions or block implementations if they depend upon the previous behavior.
Changes have been made to the RTWInfo property of Simulink.Signal and Simulink.Parameter data objects.
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.
The Real-Time Workshop software V4.1 (R12) includes the following bug fixes.
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.
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.
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.
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.
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 |
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.
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.
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.
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.
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.
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.
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.
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
Several unnecessary warnings and declarations in the generated code have been removed. These include:
In functions where the tid argument is not referenced, the declaration
(void)tid
is no longer generated. (The tid argument is required because the function API is predefined.)
Warnings involving const casts were suppressed in some of the rtw/c/libsrc modules.
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.
A segmentation fault during generation of S-functions was removed by fixing the memory management of the port data structure.
Fixed a bug where local variables of calling functions were sometimes incorrectly visible to called functions.
The ISINF, ISNAN, and ISFINITE functions now work for complex values.
The %filescope directive now works as documented.
Zero indexing on complex numbers is now supported.
In prior releases, the Target Language Compiler allowed 0 indexing for integer and real values, but not for complex values. This restriction has been removed in the Target Language Compiler 4.1, as shown in the following example.
%assign a = 1.0 + 3.0i %assign b = a[0] %% zero index now allowed
Fixed a crash that occurred if ROLL_ITERATIONS was called outside of a %roll construct. ROLL_ITERATIONS returns NULL if called outside of a %roll construct.
TLC now allows use of any path separator character independent of operating system. You can use either \ or / as a path separator character on UNIX® or Microsoft® Windows®).
Fixed a bug in the compare for equality operation. 0.0 now compares equal to -0.0.
![]() | Version 5.0 (R13) Real-Time Workshop® Software | Version 4.0 (R12) Real-Time Workshop® Software | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |