Product Support
1801 - Upgrading your Simulink Model from a Previous Version Guide
This document describes the issues involved with upgrading a Simulink model to the current version from previous versions. Problems can arise due to new blocks or libraries, the support of new signal types (frame-based and matrix signals), or changes in the name or functionality of a block. Failure to update your model can lead to problems, such as segmentation violations or seemingly inconsistent results. These issues are not limited to Simulink alone. Many other blocksets have similar upgrading issues. To avoid these problems, Simulink and several other blocksets have built-in tools that aid in updating your model. It is important to update every block in your model (from Simulink and all other blocksets). This document explains how to update your model.
Table of Contents:
- Review of Migration/Update methods used in Simulink
- Simulink Library
- Stateflow
- CDMA Reference Blockset
- Communications Blockset
- Signal Processing Blockset
- Gauges Blockset
- Simulink Fixed Point
- Fuzzy Logic Toolbox
- NCD Blockset
- SimPowerSystems
- Real-Time Workshop
Section 1: Review of Migration/Update methods used in Simulink
When a block update is needed, the Migration/Update philosophy of Simulink models is that the new block preserves the old blocks settings and function.
Default values for new settings are chosen to not change old blocks function, and values for any settings that exist in both old and new are set to the old blocks
values. There are various methods that The MathWorks uses within its own products, and some methods can also be used by customers as they update their custom
block libraries.
Here is a summary of those methods.
Default Parameters
When you load a model from a previous version into a newer version of Simulink, the loader notes the version difference. For built-in blocks that existed in the
previous version, any unspecified parameters are given their default value. The default value of any new parameter is set to preserve the previous versions
function. Note that this should not be confused with the file-default for parameters in each .mdl file used as a form of compression. If you save the model
using the new version of Simulink, it will use the current .mdl file format.
Parameter Aliasing
(Circa R13) When the name of a parameter has changed from a previous version of Simulink to a newer version of Simulink, the name change is registered with Simulink
as a parameter alias. When the file is loaded, the old parameter name is identified and its value is mapped onto the new parameter name. If you save the model using
the new version of Simulink, it will use the current .mdl file format.
Library Forwarding
(Circa R13), if a block has a changed name or has been combined with another block, we have used a forwarding table in the library to tell Simulink how to update the
old model file block to the current block. For example, Fixed-Point Blockset blocks were moved into simulink.mdl and old .mdl files "just worked" with
no update action required.
Library Links
Customer models that have library links to masked blocks in MathWorks block libraries such as simulink.mdl will pick up the new block behavior when the model loads the
library. No upgrade action is needed.
SLUPDATE command
This command has two main functions: (1) pre-R12 block upgrades to R12 or R12.1 behavior and (2) cleaning of properties and attributes. For the cleaning topic, two
examples are re-establishing broken links to MathWorks block libraries (needed in particular for updating to MathWorks S-function parameter changes) and updating
certain aspects of configuration sets in R14.
Customers should evaluate each of these technologies. The first four items are all "automatic" in that no user action is required to get the behavior. Parameter Aliasing, Library Forwarding, and of course Library Links are available to customers for their own internal migration and upgrade. Since the SLUPDATE command is an M-file, it can be used as a style guide for certain upgrades of customer-defined blocks. However, Library Forwarding is more powerful compared to SLUPDATE (and is why The MathWorks uses Library Forwarding and Parameter Aliasing for mostly all of our internal compatibility work).
Reference Documentation and Information:
Parameter Aliasing and Library Forwarding
http://www.mathworks.com/access/helpdesk/help/toolbox/simulink/ug/bqhf5p7.html
web([docroot,'/toolbox/simulink/ug/bqhf5p7.html'])
Library Links
http://www.mathworks.com/access/helpdesk/help/toolbox/simulink/ug/f13-85323.html
web([docroot,'/toolbox/simulink/ug/f13-85323.html'])
SLUPDATE Command
http://www.mathworks.com/access/helpdesk/help/toolbox/simulink/slref/slupdate.html
web([docroot,'/toolbox/simulink/slref/slupdate.html'])
Section 2: Simulink Library
If your Simulink model contains blocks from older versions of Simulink and you try to run your model using the most current version of Simulink, you may see several warning messages in your MATLAB command window. Here is an example of one of these warning messages.
Warning: Run 'slupdate('your_model_name')' to convert the block diagram to the format of the current version of Simulink.The SLUPDATE command can be used to replace blocks from a previous release with newer ones. SLUPDATE(SYS) replaces older, obsolete versions of blocks within the model SYS with the latest Simulink versions. Be sure that the model name is in single quotes. Note that the model must be open prior to calling SLUPDATE. For a list of the blocks that have been updated in the current release of Simulink, see the Simulink release notes.
When prompted, you have three options:
- y: Replace the block (default)
- n: Do not replace the block
- a: Replace all blocks without further prompting
In addition to the above changes, SLUPDATE calls ADDTERMS to terminate any unconnected input and output ports by attaching Ground and Terminator blocks respectively. SLUPDATE also converts blocks to links in the appropriate block libraries.
Note: if you have created your own subsystem in your model that has the same name as one of the subsystem blocks in the Simulink Extras Library, your block will be replaced by the built-in block. Be sure that none of your blocks share a name with a Simulink Extras block before running SLUPDATE.
For more information on SLUPDATE, type
help slupdateor
doc slupdateat the MATLAB command prompt.
You may need to upgrade your S-functions as well. To determine whether you need to upgrade your S-functions, you should include the "S-function upgrades needed" warning option. Use the following steps to do so:
- From your model, go to the "Simulation" menu and select Configuration Parameters... (Simulation Parameters...)
- Open Diagnostics in the tree view on the left, select Compatibility and find S-function upgrades needed.
(In older versions, click on the Diagnostics tab then under the "Configuration options" field, click on S-function upgrades needed ) - Change the action to warning (by default it is none)
Additional information about updating your Simulink model can be found in the Simulink release notes.
Section 3: Stateflow
Stateflow automatically upgrades all features introduced in an earlier version of Stateflow to work with the current release of the MATLAB product family.
If you open a machine from a previous version of Stateflow, you will see a warning message similar to the following:
Warning: An old Stateflow machine 'sf_car' is loaded.
This machine was saved with an older Stateflow 3.0311061000001.
Please save this machine again!
By saving the machine in the most recent version of Stateflow, your machine will be automatically upgraded.
To learn more about the new features and enhancements of Stateflow, refer to the release notes.
Section 4: CDMA Reference Blockset
In R2006b, CDMA Reference Blockset is no longer available for sale and no new feature development or further bug fixes will occur. Technical support will be offered on a limited basis, as available. Contact your sales representative with additional questions.
Communications Blockset includes and extends most of the capabilities of CDMA Reference Blockset. In addition, Communications Blockset includes WCDMA and CDMA 2000 application examples, which illustrate how to model these communication systems in Simulink.
Section 5: Communications Blockset
In Communications Blockset 2.0.1 (R12.1), there are several known issues, including limited support for matrix and frame-based signals. In a future release, more blocks will support multichannel behavior, and more blocks will be optimized for faster frame-based processing. Release 12.1 strives to be forward compatible in the sense that future signal support modes should not invalidate current modes and should minimize the difficulty of upgrading from Release 12.1 to a future release.
As a consequence of this view, some blocks now use strict guidelines to determine the kinds of signals that they accept. One consideration is that if a block will ultimately support frame-based multichannel signals, then a sample-based vector input might potentially represent either a frame of data from a single channel or a set of samples from multiple channels. Therefore, a block that does not currently provide this comprehensive signal support accepts only frame-based vectors whose interpretation is unambiguous.
Another common issue is that there may be a difference in the time delay in the Communications Blockset blocks in R12.1 versus previous releases. This difference in time delay could cause the output of your model to appear inconsistent with your results from previous versions of the blockset. If your results in Communications Blockset 2.0.1 (R12.1) appear inconsistent with results from previous versions of the blockset, you should check the time delays and make sure that they are the same.
In general, some Communications Blockset blocks in your model may need to be updated. You can determine which version the Communications Blockset blocks are from by using the COMM_LINKS command. Blocks linked to the current Communications Blockset libraries are highlighted in blue. Blocks linked to older versions of the Simulink portion of the Communications Toolbox are highlighted in red. Blocks at all levels of the model are analyzed. The red blocks should be updated.
For more information on COMM_LINKS, see the documentation, or
doc comm_links
at the MATLAB command prompt.
The release notes for the current version of the Communications Blockset and links to the release notes for older versions can be found here.
Section 6: Signal Processing Blockset
If you are using Signal Processing Blockset 4.0 (R12) or Signal Processing Blockset 4.1 (R12.1) with blocks from previous versions of the Signal Processing Blockset, you will probably have to update or replace these blocks. The DSP_LINKS command can be used to determine which blocks in the model are from older versions of the Signal Processing Blockset. For each block in the current model, DSP_LINKS replaces the block name with the full path name to the block's library link in the Signal Processing Blockset. Blocks linked to 4.0 or later Signal Processing Blockset blocks are highlighted in green while blocks linked to Signal Processing Blockset 3.0 blocks are highlighted in yellow. Blocks at all levels of the model are analyzed.
See the documentation for more information about DSP_LINKS, or
doc dsp_links
at the MATLAB command prompt.
There are many new features for the Signal Processing Blockset that became available with R12 and R12.1. For more information about these features, refer to the release notes for the Signal Processing Blockset 4.0 (R12) and the Signal Processing Blockset 4.1 (R12.1).
The release notes for the current version of the Signal Processing Blockset and links to the release notes for older versions can be found here.
You can also refer to the Signal Processing Blockset Readme.m file. You can open this file by typing whatsnew dspblks or info dspblks at the MATLAB command line.
Section 7: Gauges Blockset
The Gauges Blockset will automatically update when you save your model. If you are using a model that contains Gauges Blockset blocks that are from an older version of the blockset, simply save your model when you open it from the newer version.
For more information about new features in the Gauges Blockset, see the release notes.
Section 8: Simulink Fixed Point
If you are using the most current version of the Simulink Fixed Point with blocks from previous versions of the Fixed-Point Blockset, your model may contain obsolete blocks. The FPUPDATE command can be used to update obsolete fixed-point blocks from previous Simulink Fixed Point releases to current fixed-point blocks.
fpupdate('model')
replaces all obsolete fixed-point blocks contained in the model with current fixed-point blocks. The model must be opened prior to calling FPUPDATE.
fpupdate('model',blkprompt)
prompts you for replacement of obsolete blocks. If blkprompt is 0 (the default), you will not be prompted. If blkprompt is 1, you
will have these three options:
- y (default) replaces the block
- n does not replace the block
- a replaces all blocks without further prompting
Breaking library links to fixed-point blocks will almost certainly produce an error when you attempt to run the model. If broken links exist, you will likely uncover them when upgrading to the latest release of the Fixed Point Blockset. In Simulink Fixed Point 5.0 (R14) and later versions, broken links are discovered automatically. In earlier versions, the FIXPT_RESTORE_LINKS command can be used to restore links for fixed-point blocks.
See the documentation on FPUPDATE and FIXPT_RESTORE_LINKS for more information. In R14, the FPUPDATE and FIXPT_RESTORE_LINKS functions are obsolete. These functions are no longer needed to update models
The release notes for the current version of the Simulink Fixed Point can be found here.
Section 9: Fuzzy Logic Toolbox
For more information about new features and known issues for the Fuzzy Logic Toolbox, refer to the release notes.
Section 10: NCD Blockset
If you would like more information on the NCD Blockset, see the product information page.
Section 11: SimPowerSystems
SimPowerSystems will automatically update your SimPowerSystems blocks when you save your model. If you are using a model that contains SimPowerSystem blocks that are from a previous version of the blockset, simply save your model when you open it from the newer version.
For more information about new features of SimPowerSystems, refer to the release notes.
Section 12: Real-Time Workshop
For more information about new features of Real-Time Workshop, refer to the release notes.
Store