Known Software and Documentation Problems

This document describes important known software and documentation problems.

Real-Time Workshop 3.2.1

Click on a problem area listed below for details.

Closing a Model During Code Generation Causes Segmentation Violation
Included Files Documentation Error
Look-Up Table 2-D Does Not Support Changing Number of Repeated Zeros/Points
Target Language Compiler Crashes When Out of Memory

Closing a Model During Code Generation Causes Segmentation Violation

If you attempt to close a model while Real-Time Workshop is generating code or the code is beig compiled, unpredictable things may happen, up to and including segmentation violations.

The MathWorks plans to addres this issue in a future release, but when using the current release and all prior releases, please do not close a model while a build is in process.

Included Files Documentation Error

Page 9 of the shipped version of Real-Time Workshop 5.0 Release Notes indicates that in generated code, model_private.h is sub- included by model.h. This is incorrect; model.h does not include model_private.h.

The section "Application Modules for Application Components" on page 7- 33 of the Program Architecture chapter of the Real-Time Workshop documentation also incorrectly states that model_private.h is sub-included by model.h.

On page 2-9 of “Getting Started with Real-Time Workshop” the section “Building an Application: Summary of Files Created by the Build Procedure” also incorrectly states that model.h includes model_private.h. The diagram of file inclusions in Figure 2- 12 on page 2-50 is correct, however.

Look-Up Table 2-D Does Not Support Changing Number of Repeated Zeros/Points

When code is generated for the Look-Up Table 2-D or Look-Up Table 1-D block for floating-point parameters with binary search, extrapolation, and linear interpolation selected, the number and position of repeated zeros is generated explicitly into the generated code. If the breakpoint parameters are then tuned in the real-time code during execution and the number or position of repeated zeros changes, the generated code will in most cases get an incorrect answer when the input for that breakpoint set is near zero.

The workaround is to not change the number or position of reapated zeros in breakpoint parameters for the Look-Up Table 1-D and Look-Up Table 2-D blocks.

Target Language Compiler Crashes When Out of Memory

If the Target Language Compiler exhausts available memory, causes MATLAB to hang or crash.

Simulink 5.1.1

Click on a problem area listed below for details.

Cannot Break Library Links in a Configurable Subsystem
Changing a Subsystem I/O Port Number Can Corrupt a Model
Deadzone Block Outputs Different Result in Simulation and Code Generation
Disabling a Library Link to an Open Library Fails to Reflect Changes
Function-Call Subsystem Enabling Issue
Help ->Blocksets Submenu Sometimes Fails to Appear
N-D Lookup Table Block Does Incomplete Error Checking
PostSaveFcn Cannot Find Model on First Save
Repeating Sequence Block's Output Differs Slightly from Windows to Linux
Saturation Block's Output for a NaN Input Differs on Different Platforms
S-Function Builder Causes MATLAB to Hang If mex Is Not Set Up Correctly
The set_param command doesn't always works for some blocks
Zero Sample Time Limitation on Discretizing Models in the S Domain

Cannot Break Library Links in a Configurable Subsystem

Simulink does not allow you to break library links in a configurable subsystem because Simulink needs the links to reconfigure the subsystem when you choose a new configuration. Breaking links would be useful only if you never intended to reconfigure the subsystem, in which case you could simply replace the configurable subsystem with a nonconfigurable subsystem that implements the permanent configuration.

Changing a Subsystem I/O Port Number Can Corrupt a Model

Changing the number of an input or output port number in a subsystem can cause an extra port to be added to the subsystem block in the parent system.

To fix the problem:

  1. Copy the contents of the subsystem to the clipboard.
  2. Delete the old subsystem block.
  3. Create a new subsystem block in its place.
  4. Copy the contents from the clipboard to the subsystem.
  5. Reconnect the subsystem.

Deadzone Block Outputs Different Result in Simulation and Code Generation

In simulation, the Deadzone block outputs NaN when input is NaN, whereas it outputs 0 in Real-Time Workshop code generation. This bug is planned to be fixed in a future release.

Disabling a Library Link to an Open Library Fails to Reflect Changes

If you change the contents of a subsystem in a library and then disable a link to the changed subsystem while the library is still open, Simulink does not copy the changes from the library to the model containing the disabled link. Release 14 fixes the problem.

Function-Call Subsystem Enabling Issue

The trigger port of a function-call subsystem can specify reset states on enable for its States when enabling parameter only if its initiator issues an explicit enable. Suppose a function-call subsystem's trigger port specifies reset for its States when enabling parameter. That setting is only guaranteed to be honored if the s-function serving as the initiator of the function-call subsystem explicitly issues enable and disable events. If reset is specified and the s-function does not explicitly issue events, and error will be reported in Release 14.

A way to correct the model is to choose inherit or held as the setting of the trigger port's States when enabling parameter. Another way is to update the S-function as described in the documentation. Function Call Generator and Stateflow blocks do explicitly issue events, so this note does not apply to them.

Help ->Blocksets Submenu Sometimes Fails to Appear

The Blocksets submenu sometimes fails to appear when selected from the model window's Help menu. If this happens, click anywhere in the model window and then select "Blocksets" from the Help menu.

N-D Lookup Table Block Does Incomplete Error Checking

This release fails to report an error for an unsupported combination of settings for this block: you cannot set the interpolation method to be none-flat and the extrapolation method to be linear. This combination of settings causes a code generation failure.

PostSaveFcn Cannot Find Model on First Save

The first time you save a new model that has PostSaveFcn functions, the PostSaveFcn functions cannot find the model.

Repeating Sequence Block's Output Differs Slightly from Windows to Linux

The Repeating Sequence block generates different numbers on Windows than on Linux. The differences are slight: on the order of 1e-16. However, the differences can be significant when simulation results depend on comparing the generated sequence, e.g., to zero.

A workaround is to quantize the output of the Repeating Sequence block so that values near 0 become zero. For example, you could put a Dead Zone block with zone [0...1e-15] between the Repeating Sequence block and the block performing the comparison.

Saturation Block's Output for a NaN Input Differs on Different Platforms

On Linux, the Saturation block outputs NaN if its input is NaN; on Windows, the block outputs its lower limit if its input is NaN.

S-Function Builder Causes MATLAB to Hang If mex Is Not Set Up Correctly

The S-function Builder block causes MATLAB to hang if the compiler options file is not set up correctly.

To avoid this problem, type the following at MATLAB command prompt to configure the compiler options file:

mex -setup

The set_param command doesn't always works for some blocks

In this release, using a set_param command to set a parameter of a Data Store Read/Write block or Goto/From block sets the parameter only if the block's dialog box has not been previously opened in the session.

Zero Sample Time Limitation on Discretizing Models in the S Domain

When discretizing a model in the S domain, you cannot specify a sample time of 0 if the model contains a Transfer Function, State Space, or Zero Pole block. If you do specify a sample time of 0, MATLAB generates an error.

Stateflow 5.1.2

Click on a problem area listed below for details.

Borland 5.6 MEX Compiler Not Supported
Out-of-Range Initial Values
Stateflow Demo Version Runs When Maximum Users of Stateflow Is Reached

Borland 5.6 MEX Compiler Not Supported

Stateflow models do not build if Borland 5.6 is chosen to be the MEX compiler.
You can use Borland Compiler 5.x versions earlier than 5.6 as the MEX compiler for building Stateflow models.

Out-of-Range Initial Values

Stateflow does not check initial, minimum, and maximum values for data to ensure that they will fit in the data type. In addition, chart input data and machine parented data are not checked at run-time for out-of-range violations.

Stateflow Demo Version Runs When Maximum Users of Stateflow Is Reached

Whenever the maximum allowed number of users of Stateflow is reached, a demo version of Stateflow runs instead, without an error or warning message.