Simulink Checks - MATLAB & Simulink (original) (raw)
Simulink Check Overview
Use the Simulink® Model Advisor checks to configure your model for simulation.
See Also
- Run Model Advisor Checks
- Simulink Check Checks (Simulink Check)
By Product Overview
Use the By Product Model Advisor checks to configure your model The MathWorks® product applications.
See Also
By Task Overview
Use the By Task Model Advisor checks to configure your model for specific tasks.
See Also
Model Referencing Overview
Use the Model Referencing Model Advisor checks to configure your model for model referencing considerations.
See Also
- Run Model Advisor Checks
- Simulink Check Checks (Simulink Check)
Simulink Model File Integrity
Use the Simulink Model File Integrity Model Advisor checks to find problems with character encoding and nondefault model properties.
See Also
Units Inconsistencies
Use the Units Inconsistencies Model Advisor checks to find inconsistencies with unit specifications.
See Also
- Identify unit mismatches in the model
- Identify automatic unit conversions in the model
- Identify disallowed unit systems in the model
- Identify undefined units in the model
Managing Library Links Overview
Use the Managing Library Links Model Advisor checks to find common problems with library links.
See Also
- Run Model Advisor Checks
- Simulink Check Checks (Simulink Check)
Migrating to Simplified Initialization Mode Overview
Simplified initialization mode was introduced in R2008b to improve the consistency of simulation results. This mode is especially important for models that do not specify initial conditions for conditionally executed subsystem output ports. For more information, see Simplified Initialization Mode andClassic Initialization Mode.
Use the Model Advisor checks in Migrating to Simplified Initialization Mode to help migrate your model to simplified initialization mode.
See Also
- Simplified Initialization Mode
- Classic Initialization Mode
- Underspecified initialization detection
- Check usage of Merge blocks
- Check usage of Outport blocks
- Check usage of Discrete-Time Integrator blocks
- Check model settings for migration to simplified initialization mode
Modeling Guidelines for MISRA C:2012 Overview
These Model Advisor checks facilitate designing and troubleshooting models, subsystems, and the corresponding generated code for applications to comply with MISRA C:2012.
See Also
Modeling Guidelines for Secure Coding (CERT C, CWE, ISO/IEC TS 17961)
These Model Advisor checks facilitate designing and troubleshooting models, subsystems, and the corresponding generated code for applications to comply with the CERT C, CWE, ISO/IEC TS 17961 secure coding standards.
See Also
- Secure Coding (Embedded Coder)
- Run Model Advisor Checks
Upgrading to the Current Simulink Version Overview
Use the Open the Upgrade Advisor check to access the Upgrade Advisor. Use the Upgrade Advisor for help with using the current release to upgrade and improve models. The Upgrade Advisor identifies cases where you can benefit by changing your model to use new features and settings in Simulink. The Advisor provides advice for transitioning to new technologies, and upgrading a model hierarchy.
The Upgrade Advisor also identifies cases when a model will not work because changes and improvements in Simulink require changes to a model.
The Upgrade Advisor offers options to perform recommended actions automatically or instructions for manual fixes.
Alternatively, you can open the Upgrade Advisor in the following ways:
- From the Model Editor, in the Modeling tab, select > .
- From the MATLAB® command line, use the
upgradeadvisor
function:
See Also
Modeling Signals and Parameters Using Buses Overview
Use the Modeling Signals and Parameters Using Buses checks to find common problems with signals and parameters when using buses.
See Also
Code Generation Efficiency Overview
Use the Code Generation Efficiency checks to configure your model with consideration for code generation efficiency.
See Also
Data Transfer Efficiency Overview
Use the Data Transfer Efficiency checks to configure your model with consideration for data transfer efficiency.
See Also
Modeling Standards for DO-178C/DO-331 Overview
These Model Advisor checks facilitate designing and troubleshooting models from which code is generated for applications that must meet safety or mission-critical requirements.
The Model Advisor performs a checkout of the Simulink Check™ license when you run the checks.
See Also
- Radio Technical Commission for Aeronautics (RTCA) for information on the DO-178C Software Considerations in Airborne Systems and Equipment Certification and related standards
Requirements Traceability Overview
Model Advisor checks for requirements traceability.
See Also
Model Diagnostic Settings Overview
Model Advisor checks for model diagnostic settings.
See Also
Simulink Overview
Model Advisor checks for Simulink modeling elements.
See Also
Stateflow Overview
Model Advisor checks for Stateflow® modeling objects.
See Also
Library Links Overview
Model Advisor checks for library links.
See Also
Model Referencing Overview
Model Advisor checks for referenced models.
See Also
Bug Reports Overview
Checks to display bug reports.
See Also
Simulink Coder Overview
Model Advisor checks for Simulink Coder™.
See Also
- Model Advisor Checks (Simulink Coder)
- Run Model Advisor Checks
Modeling Standards for ISO 26262 Overview
These Model Advisor checks facilitate designing and troubleshooting models, subsystems, and the corresponding generated code for applications to comply with ISO 26262–6.
The Model Advisor performs a checkout of the Simulink Check license when you run the modeling standards for ISO 26262 checks.
Tip
If your model uses model referencing, run the checks on all referenced models before running them on the top model.
See Also
- International Organization for Standardization for information on ISO 26262–6 Road vehicles — Functional safety — Part 6: Product development: Software level
- ISO 26262: 2018 (Embedded Coder)
- Modeling Guidelines for ISO 26262-6: 2018 (IEC Certification Kit)
- Run Model Advisor Checks
Modeling Standards for IEC 61508 Overview
These Model Advisor checks facilitate designing and troubleshooting models, subsystems, and the corresponding generated code for applications to comply with IEC 61508-3.
The Model Advisor performs a checkout of the Simulink Check license when you run the modeling standards for IEC 61508 checks.
Tip
If your model uses model referencing, run the checks on all referenced models before running them on the top model.
See Also
- International Electrotechnical Commission for more information on IEC 61508–3 Functional safety of electrical/electronic/programmable electronic safety-related systems — Part 3: Software requirements
- IEC 61508: 2010 (Embedded Coder)
- Run Model Advisor Checks
Modeling Standards for IEC 62304 Overview
These Model Advisor checks facilitate designing and troubleshooting models, subsystems, and the corresponding generated code for applications to comply with IEC 62304.
The Model Advisor performs a checkout of the Simulink Check license when you run the modeling standards for IEC 62304 checks.
Tip
If your model uses model referencing, run the checks on all referenced models before running them on the top model.
See Also
- MATLAB and Simulink for Medical Devices for more information on IEC 62304 Medical device software - Software life cycle processes
- IEC 62304: 2015 (Embedded Coder)
- Run Model Advisor Checks
Modeling Standards for EN 50128 Overview
These Model Advisor checks facilitate designing and troubleshooting models, subsystems, and the corresponding generated code for applications to comply with the EN 50128 standard.
The Model Advisor performs a checkout of the Simulink Check license when you run the modeling standards for EN 50128 checks.
Tip
If your model uses model referencing, run the checks on all referenced models before running them on the top model.
See Also
- European Committee for Electrotechnical Standardization for more information on EN 50128 (Railway applications — Software for railway control and protection systems)
- EN 50128 / EN 50128: 2011 (Embedded Coder)
- Run Model Advisor Checks
Modeling Standards for ISO 25119 Overview
These Model Advisor checks facilitate designing and troubleshooting models, subsystems, and the corresponding generated code for applications to comply with ISO 25119.
The Model Advisor performs a checkout of the Simulink Check license when you run the modeling standards for ISO 25119 checks.
Tip
If your model uses model referencing, run the checks on all referenced models before running them on the top model.
See Also
- ISO 25119 Standard (Embedded Coder)
- Run Model Advisor Checks
Requirements Consistency Checking Overview
Checks consistency of requirements.
The Model Advisor performs a checkout of the Simulink Check license when you run the requirements consistency checking checks.
See Also
- Run Model Advisor Checks
- Simulink Checks
- Model Advisor Checks (Simulink Coder)
S-function Checks Overview
Checks the S-functions in a model or a library to identify potential problems and improvements.
See Also
Modeling Single-Precision Systems Overview
Checks for blocks that introduce double-precision operations.
See Also
- Run Model Advisor Checks
- Simulink Checks
- Model Advisor Checks (Simulink Coder)
Identify unconnected lines, input ports, and output ports
Check ID:mathworks.design.UnconnectedLinesPorts
Check for unconnected lines or ports.
Description
This check lists unconnected lines or ports. These can have difficulty propagating signal attributes such as data type, sample time, and dimensions.
Note
Ports connected to ground/terminator blocks will pass this test.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Lines, input ports, or output ports are unconnected. | Connect the signals. Double-click the list of unconnected items to locate failure. |
Capabilities and Limitations
You can:
- Run this check on your library models.
- Exclude blocks and charts from this check if you have aSimulink Check license.
Tips
Use the PortConnectivity
command to obtain an array of structures describing block input or output ports.
See Also
Common Block Properties for information on the PortConnectivity
command.
Model Advisor Exclusion Overview (Simulink Check)
Check root model Inport block specifications
Check ID:mathworks.design.RootInportSpec
Check that root model Inport blocks fully define dimensions, sample time, and data type.
Description
Using root model Inport blocks that do not fully define dimensions, sample time, or data type can lead to undesired simulation results. Simulink software back-propagates dimensions, sample times and data types from downstream blocks unless you explicitly assign them values.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Root-level Inport blocks have undefined attributes. | Fully define the attributes of the root-level Inport blocks. |
Capabilities and Limitations
If you have a Simulink Check license, you can exclude blocks and charts from this check.
Tips
The following configurations pass this check:
- Configuration Parameters > Solver > Periodic sample time constraint is set to
Ensure sample time independent
- For export-function models, inherited sample time is not flagged.
See Also
- About Data Types in Simulink.
- Determine Signal Dimensions.
- Model Advisor Exclusion Overview (Simulink Check)
- Specify Sample Time
- Periodic sample time constraint
Check optimization settings
Check ID:mathworks.design.OptimizationSettings
Check for optimizations that can lead to non-optimal code generation and simulation.
Description
This check reviews the status of optimizations that can improve code efficiency and simulation time.
Results and Recommended Actions
Tips
If the system contains Model blocks and the referenced model is in Accelerator mode, simulating the model requires generating and compiling code.
check
See Also
- Model Configuration Parameters: Code Generation Optimization (Simulink Coder)
Check diagnostic settings ignored during accelerated model reference simulation
Check ID:mathworks.design.ModelRefSIMConfigCompliance
Checks for referenced models for which Simulink changes configuration parameter settings during accelerated simulation.
Description
For models referenced in accelerator mode, Simulink ignores the settings of the following configuration parameters that you set to a value other than None
.
- Array bounds exceeded
- > >
- > >
- > >
Also, for models referenced in accelerator mode, Simulink ignores the following > > > parameters if you set them to a value other thanDisable all
. For details, see Data Store Diagnostics.
- Detect read before write
- Detect write after read
- Detect write after write
Results and Recommended Actions
Condition | Recommended Action |
---|---|
You want to see the results of running the identified diagnostics with settings to produce warnings or errors. | Simulate the model in Normal mode and resolve diagnostic warnings or errors. |
Check for parameter tunability information ignored for referenced models
Check ID:mathworks.design.ParamTunabilityIgnored
Checks if parameter tunability information is included in the Model Parameter Configuration dialog box.
Description
Simulink software ignores tunability information specified in the Model Parameter Configuration dialog box. This check identifies those models containing parameter tunability information that Simulink software will ignore if the model is referenced by other models.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Model contains ignored parameter tunability information. | Click the links to convert to equivalent Simulink parameter objects in the MATLAB workspace. |
See Also
- Create Tunable Calibration Parameter in the Generated Code (Simulink Coder)
Check for implicit signal resolution
Check ID:mathworks.design.ImplicitSignalResolution
Identify models that attempt to resolve named signals and states toSimulink.Signal
objects.
Description
Requiring Simulink software to resolve all named signals and states is inefficient and slows incremental code generation and model reference. This check identifies those signals and states for which you may turn off implicit signal resolution and enforce resolution.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Not all signals and states are resolved. | Turn off implicit signal resolution and enforce resolution for each signal and state that does resolve. |
See Also
Resolve Signal Objects for Output Variables.
Check for optimal bus virtuality
Check ID:mathworks.design.OptBusVirtuality
Identify virtual buses that could be made nonvirtual. Making these buses nonvirtual improves generated code efficiency.
Description
This check identifies blocks incorporating virtual buses that cross a model reference boundary. Changing these to nonvirtual improves generated code efficiency.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Blocks that specify a virtual bus crossing a model reference boundary. | Change the highlighted bus to nonvirtual. |
Capabilities and Limitations
You can:
- Run this check on your library models.
- Exclude blocks and charts from this check if you have aSimulink Check license.
See Also
- Signal Basics
- Composite Interface Guidelines
- Model Advisor Exclusion Overview (Simulink Check)
Check for Discrete-Time Integrator blocks with initial condition uncertainty
Check ID:mathworks.design.DiscreteTimeIntegratorInitCondition
Identify Discrete-Time Integrator blocks with state ports and initial condition ports that are fed by neither an Initial Condition nor a Constant block.
Description
Discrete-Time Integrator blocks with state port and initial condition ports might not be suitably initialized unless they are fed from an Initial Condition or Constant block. This is more likely to happen when Discrete-Time Integrator blocks are used to model second-order or higher-order dynamic systems.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Discrete-Time Integrator blocks are not initialized during the model initialization phase. | Add a Constant or Initial Condition block to feed the external Initial Condition port. |
Capabilities and Limitations
You can:
- Run this check on your library models.
- Exclude blocks and charts from this check if you have aSimulink Check license.
See Also
- IC block
- Discrete-Time Integrator block
- Constant block
- Model Advisor Exclusion Overview (Simulink Check)
Identify disabled library links
Check ID:mathworks.design.DisabledLibLinks
Search model for disabled library links.
Description
Disabled library links can cause unexpected simulation results. Resolve disabled links before saving a model.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Library links are disabled. | Click the Library Link > Resolve link option in the context menu. |
Capabilities and Limitations
You can:
- Run this check on your library models.
- Exclude blocks and charts from this check if you have aSimulink Check license.
Tips
- Use the Model Browser to find library links.
- To enable a broken link, right-click a block in your model to display the context menu. Select > .
See Also
Model Advisor Exclusion Overview (Simulink Check)
Check for large number of function arguments from virtual bus across model reference boundary
Check ID:mathworks.design.CheckVirtualBusAcrossModelReferenceArgs
Checks virtual buses that cross model reference boundaries and flags cases where using virtual buses across a model reference boundary increases the number of function arguments significantly.
Description
To improve the speed of the code generation process, you can use this check to reduce the number of generated function arguments. If the check finds a model that where many arguments will be generated for a function, you can clickUpdate Model to modify the model so that it generates fewer arguments.
Results and Recommended Action
Methods that generate many function arguments as the result of a virtual bus crossing model reference boundary slow down the code generation process.
Condition | Recommended Action |
---|---|
Methods are listed that generate a large number of arguments for the current the model configuration that this check can reduce by modifying the model. | Click Update Model. |
Clicking Update Model resets Inport andOutport block parameters and inserts Signal Conversion blocks, as necessary, to reduce the number of generated function arguments for the model.
See Also
Identify parameterized library links
Check ID:mathworks.design.ParameterizedLibLinks
Search model for parameterized library links.
Description
Parameterized library links that are unintentional can result in unexpected parameter settings in your model. This can result in improper model operation.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Parameterized links are listed. | Verify that the links are intended to be parameterized. |
Capabilities and Limitations
You can:
- Run this check on your library models.
- Exclude blocks and charts from this check if you have aSimulink Check license.
Tips
- Right-click a block in your model to display the context menu. Choose
Link Options
and clickGo To Library Block
to see the original block from the library. - To parameterize a library link, choose
Look Under Mask
, from the context menu and select the parameter.
See Also
Model Advisor Exclusion Overview (Simulink Check)
Identify unresolved library links
Check ID:mathworks.design.UnresolvedLibLinks
Search the model for unresolved library links, where the specified library block cannot be found.
Description
Check for unresolved library links. Models do not simulate while there are unresolved library links.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Library links are unresolved. | Locate missing library block or an alternative. |
Capabilities and Limitations
You can:
- Run this check on your library models.
- Exclude blocks and charts from this check if you have aSimulink Check license.
See Also
Model Advisor Exclusion Overview (Simulink Check)
Identify configurable subsystem blocks for converting to variant subsystem blocks
Check ID:mathworks.design.CSStoVSSConvert
Search the model to identify configurable subsystem blocks at the model or subsystem level.
Results and Recommended Actions
Capabilities and Limitations
You can run this check on your library models.
See Also
Simulink.VariantUtils.convertToVariantSubsystem
Identify Variant Model blocks and convert those to Variant Subsystem containing Model block choices
Check ID:mathworks.design.ConvertMdlrefVarToVSS
Search the model to identify Variant Model blocks.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Variant Model blocks available in the model are listed. | Convert these blocks to Variant Subsystem blocks. |
See Also
Simulink.VariantUtils.convertToVariantSubsystem
Identify Variant blocks using Variant objects with empty conditions
Check ID:mathworks.design.emptyVariantObjects
Search the model to identify the Variant blocks or library having empty Variant objects.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
The Variant blocks in the model or library having empty Variant objects are listed. | Use valid conditions in the variant objects. |
See Also
Introduction to Variant Controls
Check usage of function-call connections
Check ID:mathworks.design.CheckForProperFcnCallUsage
Check model diagnostic settings that apply to function-call connectivity and that might impact model execution.
Description
Check for connectivity diagnostic settings that might lead to non-deterministic model execution.
Results and Recommended Actions
See Also
Managing Data Store Memory Blocks
Use these checks for the Data Store Memory Blocks to configure your model for acceptable usage of Data Store Memory blocks.
See Also
- Run Model Advisor Checks
- Model Advisor Checks (Simulink Coder)
- Simulink Check Checks (Simulink Check)
Check Data Store Memory blocks for multitasking, strong typing, and shadowing issues
Check ID:mathworks.design.DataStoreMemoryBlkIssue
Look for modeling issues related to Data Store Memory blocks.
Description
Checks for multitasking data integrity, strong typing, and shadowing of data stores of higher scope.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
The Duplicate data store names check is set tonone or warning. | Consider setting the Duplicate data store names check toerror in the Configuration Parameters dialog box, on the Diagnostics > Data Validity pane. |
The data store variable names are not strongly typed in one of the following: Signal Attributes pane of the Block Parameters dialog box for the Date Store MemoryblockGlobal data store name | Specify a data type other than auto by taking one of the following actions: Choose a data type other than Inherit: auto on theSignal Attributes pane of the Block Parameters dialog box for the Date Store Memoryblock.If you are using a global data store name, then specify its data type in theSimulink.Signal object. |
The Multitask data store check is set tonone or warning. | Consider setting the Multitask data store check toerror in the Configuration Parameters dialog box, on the Diagnostics > Data Validity pane. |
Capabilities and Limitations
If you have a Simulink Check license, you can exclude blocks and charts from this check.
See Also
- Local and Global Data Stores
- Storage Classes for Data Store Memory Blocks (Simulink Coder)
- Data Store Memory
- Data Store Read
- Data Store Write
- Duplicate data store names
- Multitask data store
- Model Advisor Exclusion Overview (Simulink Check)
Check if read/write diagnostics are enabled for data store blocks
Check ID:mathworks.design.DiagnosticDataStoreBlk
For data store blocks in the model, enable the read-and-write diagnostics order checking to detect run-time issues.
Description
Check for the read-and-write diagnostics order checking. By enabling the read-and-write diagnostics, you detect potential run-time issues.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
The Detect read before write check is disabled. | Consider enabling Detect read before write in the Configuration Parameter dialog boxDiagnostics > Data Validity pane. |
The Detect write after read check is disabled. | Consider enabling Detect write after read in the Configuration Parameter dialog boxDiagnostics > Data Validity pane. |
The Detect write after write check is disabled. | Consider enabling Detect write after write in the Configuration Parameter dialog boxDiagnostics > Data Validity pane. |
Capabilities and Limitations
Exclude blocks and charts from this check if you have a Simulink Check license.
Tips
.
- The run-time diagnostics can slow simulations down considerably. Once you have verified that Simulink does not generate warnings or errors during simulation, set them to
Disable all
.
See Also
- Local and Global Data Stores
- Data Store Memory
- Data Store Read
- Data Store Write
- Detect read before write
- Detect write after read
- Detect write after write
- Check for potential ordering issues involving data store access
- Model Advisor Exclusion Overview (Simulink Check)
Check data store block sample times for modeling errors
Check ID:mathworks.design.DataStoreBlkSampleTime
Identify modeling errors due to the sample times of data store blocks.
Description
Check data store blocks for continuous or fixed-in-minor-step sample times.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Data store blocks in your model have continuous or fixed-in-minor-step sample times. | Consider making the listed blocks discrete or replacing them with either Memory orGoto and From blocks. |
Capabilities and Limitations
If you have a Simulink Check license, you can exclude blocks and charts from this check.
See Also
- Local and Global Data Stores
- Data Store Memory
- Data Store Read
- Data Store Write
- Fixed-in-Minor-Step Sample Time
- Model Advisor Exclusion Overview (Simulink Check)
Check for potential ordering issues involving data store access
Check ID:mathworks.design.OrderingDataStoreAccess
Look for read/write issues which may cause inaccuracies in the results.
Description
During an , identify potential issues relating to read-before-write, write-after-read, and write-after-write conditions for data store blocks.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Reading and writing (read-before-write or write-after-read condition) occur out of order. | Consider restructuring your model so that the Data Store Read block executes before the Data Store Write block. |
Multiple writes occur within a single time step. | Change the model to write data only once per time step or refer to the following Tips section. |
Capabilities and Limitations
If you have a Simulink Check license, you can exclude blocks and charts from this check.
Tips
This check performs a static analysis which might not identify every instance of improper usage. Specifically, Function-Call Subsystems, Stateflow Charts, MATLAB for code generation, For Iterator Subsystems, and For Each Subsystems can cause both missed detections and false positives. For a more comprehensive check, consider enabling the following diagnostics on theDiagnostics > Data Validity pane in the Configuration Parameters dialog box: Detect read before write,Detect write after read, andDetect write after write.
See Also
- Local and Global Data Stores
- Data Store Memory
- Data Store Read
- Data Store Write
- Detect read before write
- Detect write after read
- Detect write after write
- Model Advisor Exclusion Overview (Simulink Check)
Check structure parameter usage with bus signals
Check ID:mathworks.design.MismatchedBusParams
Identify blocks and Simulink.Signal
objects that initialize buses by using mismatched structures.
Description
In a model, you can use a MATLAB structure to initialize a bus. For example, if you pass a bus through a Unit Delay block, you can set the Initial condition parameter to a structure. For basic information about initializing buses by using structures, see Specify Initial Conditions for Bus Elements.
Run this check to generate efficient and readable code by matching the shape and numeric data types of initial condition structures with those of buses. Matching these characteristics avoids unnecessary explicit typecasts and replaces field-by-field structure assignments with, for example, calls tomemcpy
.
Partial Structures
This check lists blocks and Simulink.Signal
objects that initialize buses by using partial structures. During the iterative process of creating a model, you can use partial structures to focus on a subset of signal elements in a bus. For a mature model, use full structures to:
- Generate readable and efficient code.
- Support a modeling style that explicitly initializes unspecified signals. When you use partial structures, Simulink implicitly initializes unspecified signals.
For more information about full and partial structures, see Specify Initial Conditions for Bus Elements.
Data Type Mismatches
This check lists blocks and Simulink.Signal
objects whose initial condition structures introduce data type mismatches. The fields of these structures have numeric data types that do not match the data types of the corresponding bus elements.
This check does not detect a mismatch for blocks, such as the Unit Delay block, that implicitly convert the data type of initial condition to the input signal.
When you configure an initial condition structure to appear as a tunable global structure in the generated code, avoid unnecessary explicit typecasts by matching the data types. See Generate Tunable Initial Condition Structure for Bus (Simulink Coder).
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Block or signal object uses partial structure | Consider using the functionSimulink.Bus.createMATLABStructure to create a full initial condition structure. |
Data types of structure fields do not match data types of corresponding signal elements | Consider defining the structure as aSimulink.Parameter object, and creating a Simulink.Bus object to use as the data type of the bus and of the parameter object. To control numeric data types, use theSimulink.BusElement objects in the bus object. |
See Also
- Specify Initial Conditions for Bus Elements
- Generate Tunable Initial Condition Structure for Bus (Simulink Coder)
- Data Stores with Signal Objects
- Simulink.Bus.createMATLABStruct
- Simulink.Signal
Check Delay, Unit Delay and Zero-Order Hold blocks for rate transition
Check ID:mathworks.design.ReplaceZOHDelayByRTB
Identify Delay, Unit Delay, or Zero-Order Hold blocks that are used for rate transition. Replace these blocks with actual Rate Transition blocks.
Description
If a model uses Delay, Unit Delay, orZero-Order Hold blocks to provide rate transition between input and output signals, Simulink makes a hidden replacement of these blocks with built-inRate Transition blocks. In the compiled block diagram, a yellow symbol and the letters “RT” appear in the upper-left corner of a replacement block. This replacement can affect the behavior of the model, as follows:
- These blocks lose their algorithmic design properties to delay a signal or implement zero-order hold. Instead, they acquire rate transition behavior.
- This modeling technique works only in specific transition configurations (slow-to-fast for Delay and Unit Delay blocks, and fast-to-slow for Zero-Order Hold block). Set the block sample time to be equal to the slower rate (source for the Delay and Unit Delay blocks and destination for the Zero-Order Hold block).
- When the block sample time of a downstream or upstream block changes, these Delay, Unit Delay andZero-Order Hold blocks might not perform rate transition. For example, setting the source and destination sample times equal stops rate transition. The blocks then assume their original algorithmic design properties.
- The block sample time shows incomplete information about sample time rates. The block code runs at two different rates to handle data transfer. However, the block sample time and sample time color show it as a single-rate block. Tools and MATLAB scripts that use sample time information base their behavior on this information.
An alternative is to replace Delay, Unit Delay, or Zero-Order Hold blocks with actual Rate Transition blocks.
- The technique ensures unambiguous results in block behavior.Delay, Unit Delay, orZero-Order Hold blocks act according to their algorithmic design to delay and hold signals respectively. OnlyRate Transition blocks perform actual rate transition.
- Using an actual Rate Transition block for rate transition offers a configurable solution to handle data transfer if you want to specify deterministic behavior or the type of memory buffers to implement.
Use this check to identify instances in your model where Delay,Unit Delay or Zero-Order Hold blocks undergo hidden replacement to provide rate transition between signals. ClickUpgrade Model to replace these blocks with actualRate Transition blocks.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Model has no instances ofDelay, Unit Delay, orZero-Order Hold blocks used for rate transition. | No action required. |
Model has instances of Delay, Unit Delay, or Zero-Order Hold blocks used for rate transition. | The check identifies these instances and allows you to upgrade the model. Click Upgrade Model to replace with actual Rate Transition blocks.Save changes to your model. |
If you do not choose to replace the Delay, Unit Delay, and/or Zero-Order Hold blocks with actualRate Transition blocks, Simulink continues to perform a hidden replacement of these blocks with built-in rate transition blocks.
Capabilities and Limitations
You can:
- Run this check on your library models.
- Exclude blocks and charts from this check if you have aSimulink Check license.
See Also
- Run Model Advisor Checks
- Model Upgrades
- Rate Transition
- Model Advisor Exclusion Overview (Simulink Check)
Check bus signals treated as vectors
Check ID:mathworks.design.BusTreatedAsVector
Identify buses that Simulink treats as vectors.
Description
You cannot use buses that the Simulink software implicitly converts to vectors. Instead, either insert aBus to Vector conversion block between the bus and the block input port that it feeds, or use theSimulink.BlockDiagram.addBusToVector
function.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Buses are implicitly converted to vectors. | UseSimulink.BlockDiagram.addBusToVector or insert a Bus to Vector block. |
Model is not configured to identify buses that Simulink treats as vectors. | In the Configuration Parameters dialog box, on theDiagnostics > Connectivity pane, set Bus signal treated as vector toerror. |
Action Results
Clicking Modify inserts a Bus to Vector block at the input ports of blocks that implicitly convert buses to vectors.
Tips
- Run this check before running Check consistency of initialization parameters for Outport and Merge blocks.
- For more information, see Identify Automatic Bus Conversions.
See Also
- Identify Automatic Bus Conversions
- Bus to Vector block
- Bus signal treated as vector
- Migrating to Simplified Initialization Mode Overview
- Simulink.BlockDiagram.addBusToVector
Check for potentially delayed function-call subsystem return values
Check ID:mathworks.design.DelayedFcnCallSubsys
Identify function-call return values that might be delayed because Simulink software inserted an implicit Signal Conversion block.
Description
So that signals reside in contiguous memory, Simulink software can automatically insert an implicit Signal Conversion block in front of function-call initiator block input ports. This can result in a one-step delay in returning signal values from calling function-call subsystems. The delay can be avoided by ensuring the signal originates from a signal block within the function-call system. Or, if the delay is acceptable, insert a Unit Delay block in front of the affected input ports.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
The listed block input ports could have an implicit Signal Conversion block. | Decide if a one-step delay in returning signal values is acceptable for the listed signals.If the delay is not acceptable, rework your model so that the input signal originates from within the calling subsystem.If the delay is acceptable, insert a Unit Delay block in front of each listed input port. |
Capabilities and Limitations
If you have a Simulink Check license, you can exclude blocks and charts from this check.
See Also
Signal Conversion block
Unit Delay block
Model Advisor Exclusion Overview (Simulink Check)
Identify block output signals with continuous sample time and non-floating point data type
Check ID:mathworks.design.OutputSignalSampleTime
Find continuous sample time, non-floating-point output signals.
Description
Non-floating-point signals might not represent continuous variables without loss of information.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Signals with continuous sample times have a non-floating-point data type. | On the identified signals, either change the sample time to be discrete or fixed-in-minor-step ([0 1]). |
Capabilities and Limitations
If you have a Simulink Check license, you can exclude blocks and charts from this check.
See Also
Model Advisor Exclusion Overview (Simulink Check)
Check usage of Merge blocks
Check ID:mathworks.design.MergeBlkUsage
Identify Merge blocks with parameter settings that can lead to unexpected behavior, and help migrate your model to simplified initialization mode.
Description
Simplified initialization mode was introduced in R2008b to improve the consistency of simulation results. For more information, see Simplified Initialization Mode and Classic Initialization Mode.
This Model Advisor check identifies settings in the Merge blocks in your model that can cause problems if you use classic initialization mode. It also recommends settings for consistent behavior of Merge blocks. The results of the subchecks contain two types of statements: Failed and Warning. Failed statements identify issues that you must address manually before you can migrate the model to the simplified initialization mode. Warning statements identify issues or changes in behavior that can occur after migration.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Check the run-time diagnostic setting of the Merge block. | In the Configuration Parameters dialog box, setDetect multiple driving blocks executing at the same time step to error. Verify that the model simulates without errors before running this check again. |
Check for Model blocks that are using the PIL simulation mode. | The simplified initialization mode does not support the Processor-in-the-loop (PIL) simulation for model references. |
Check for library blocks with instances that cannot be migrated. | Examine the failed subcheck results for each block to determine the corrective actions. |
Check for single-input Merge blocks. | Replace both the Mux block used to produce the input signal and the Merge block with one multi-input Merge block.Single-input Merge blocks are not supported in the simplified initialization mode. |
Check for root Merge blocks that have an unspecifiedInitial output value. | If you do not specify an explicit value for theInitial output parameter of_root Merge blocks_, then Simulink uses the default initial value of the output data type.A root Merge block is a Merge block with an output port that does not connect to another Merge block. For information on the default initial value, see Initialize Signal Values. |
Check for Merge blocks with nonzero input port offsets. | Clear the Allow unequal port widths parameter of the Merge block. NoteConsider using Merge blocks only for signal elements that require true merging. You can combine other elements with merged elements using theConcatenate block. |
Check for Merge blocks that have unconnected inputs or that have inputs from non-conditionally executed subsystems. | Set the Number of inputs parameter of the Merge block to the number of Merge block inputs. You must connect each input to a signal.Verify that each Merge block input is driven by a conditionally executed subsystem.Merge blocks cannot be driven directly by an Iterator Subsystem or a block that is not a conditionally executed subsystem. |
Check for Merge blocks with inputs that are combined or reordered outside of conditionally executed subsystems. | Verify that combinations or reordering ofMerge block input signals takes place within a conditionally executed subsystem. Such designs may use Mux, Bus Creator, orSelector blocks. |
Check for Merge blocks with multiple input ports that are driven by a single source. | Verify that the Merge block does not have multiple input signals that are driven by the same conditionally executed subsystem or conditionally executedModel block. |
Check for Merge blocks that use signal objects to specify theInitial output value. | Verify that the following behavior is acceptable.In the simplified initialization mode, signal objects cannot specify the Initial output parameter of the Merge block. While you can still initialize the output signal for a Merge block using a signal object, the initialization result may be overwritten by that of theMerge block.NoteSimulink generates a warning that the initial value of the signal object has been ignored. |
See Also
- Migrating to Simplified Initialization Mode Overview
- Model Advisor Exclusion Overview (Simulink Check)
Check usage of Outport blocks
Check ID:mathworks.design.InitParamOutportMergeBlk
Identify Outport blocks and conditional subsystems with parameter settings that can lead to unexpected behavior, and help migrate your model to simplified initialization mode.
Description
Simplified initialization mode was introduced in R2008b to improve the consistency of simulation results. This mode is especially important for models that do not specify initial conditions for conditionally executed subsystem output ports. For more information, see Simplified Initialization Mode and Classic Initialization Mode.
This Model Advisor check identifies Outport blocks and conditional subsystems in your model that can cause problems if you use the simplified initialization mode. It also recommends settings for consistent behavior of Outport blocks. The results of the subchecks contain two types of statements: Failed and Warning. Failed statements identify issues that you must address manually before you can migrate the model to the simplified initialization mode. Warning statements identify issues or changes in behavior can occur after migration.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Check for blocks inside of the Iterator Subsystem that require elapsed time. | Within an Iterator Subsystem hierarchy, do not use blocks that require a service that maintains the time that has elapsed between two consecutive executions.Since an Iterator Subsystem can execute multiple times at a given time step, the concept of elapsed time is not well-defined between two such executions. Using these blocks inside of an Iterator Subsystem can cause unexpected behavior. |
Check for Outport blocks that have conflicting signal buffer requirements. | The Outport block has a function-call trigger or function-call data dependency signal passing through it, along with standard data signals. Some of the standard data signals require an explicit signal buffer for the initialization of the output signal of the corresponding subsystem. However, buffering function-call related signals lead to a function-call data dependency violation.Consider modifying the model to pass function-call related signals through a separateOutport block. For examples of function-call data dependency violations, see Simulink Subsystem Semantics.A standard data signal may require an additional signal copy for one of the following reasons: The Outport block is driven by a block with output that cannot be overwritten. The Ground block and theConstant block are examples of such blocks.The Outport block shares the same signal source with anotherOutport block in the same subsystem or in one nested within the current subsystem but having a different initial output value.The Outport block connects to the input of a Merge blockOne of the input signals of theOutport block is specifying aSimulink.Signal object with an explicit initial value. |
Check for Outport blocks that are driven by a bus and whose Initial output value is not scalar. | For Outport blocks driven by buses, classic initialization mode does not support Initial Condition (IC) structures, while simplified initialization mode does. Hence, when migrating a model from classic to simplified mode, specify a scalar for the Initial Output parameter. After migration completes, to specify different initial values for different elements of the bus, use IC structures. For more information, see Specify Initial Conditions for Bus Elements. |
Check for Outport blocks that require an explicit signal copy. | An explicit copy of the bus driving theOutport block is required for the initialization of the output signal of the corresponding subsystem. Insert a Signal Conversion block before the Outport block, then set theOutput parameter of theSignal Conversion block toBus copy. A standard data signal may require an additional signal copy for one or more of the following reasons: A block with output that cannot be overwritten is driving the Outport block. TheGround block and theConstant block are examples of such blocks.The Outport block shares the same signal source with anotherOutport block in the same subsystem or in one nested within the current subsystem but having a different initial output value.The Outport block connects to the input of a Merge blockOne of the input signals of theOutport block is specifying aSimulink.Signal object with an explicit initial value. |
Check for merged Outport blocks that inherit theInitial Output value from Outport blocks that have been configured to reset when the blocks become disabled. | When Outport blocks are driving a Merge block, do not set their Output when disabled parameters toreset. |
Check for merged Outport blocks that are driven by nested conditionally executed subsystems. | Determine if the new behavior of theOutport blocks is acceptable. If it is not acceptable, modify the model to account for the new behavior before migrating to the simplified initialization mode. |
Check for merged Outport blocks that reset when the blocks are disabled. | Set the Output when disabled parameter of the Outport block toheld. This setting is required because the Outport block connects to a Merge block.For more information, see Outport. |
Check for Outport blocks that have an undefinedInitial output value with invalid initial condition sources. | Verify that the following behavior is acceptable.When the Initial output parameter is unspecified ([]), it inherits the initial output from the source blocks. If at least one of the sources of the Outport block is not a valid source to inherit the initial value, the block uses the default initial value for that data type.For simplified initialization mode, valid sources an Outport blocks can inherit the Initial output value from are: Constant, Initial Condition, Merge (with initial output), Stateflow chart, function-call model reference, or conditionally executed subsystem blocks. |
Check Outport blocks that have automatic rate transitions. | Simulink has inserted a Rate Transition block at the input of the Outport block. Specify the Initial output parameter for each Outport block.Otherwise, perform the following procedure:In the Configuration Parameters dialog box, on theSolver pane, clear the optionAutomatically handle rate transition for data transfer.Run this Model Advisor check again. |
Check Outport blocks that have a special signal storage requirement and have an undefined Initial output value. | Verify that the following behavior is acceptable.Specify the Initial output parameter for theOutport block. Set this value to[] (empty matrix) to use the default initial value of the output data type. |
Check the Initial output setting of Outport blocks that reset when they are disabled. | Specify the Initial output parameter of the Outport block.You must specify the Initial output value for blocks that are configured to reset when they become disabled. |
Check the Initial output setting for Outport blocks that pass through a function-call data dependency signal. | You cannot specify an Initial output value for the Outport block because function-call data dependency signals are passing through it. To set the Initial output value:Set the Initial output parameter of the Outport block to[].Provide the initial value at the source of the data dependency signal rather than at theOutport block. |
Check for Outport blocks that use signal objects to specify the Initial output value. | Verify that the following behavior is acceptable.In the simplified initialization mode, signal objects cannot specify the Initial output parameter of an Outport block. You can still initialize the input or output signals for an Outport block using signal objects, but the initialization results may be overwritten by those of the Outport block.NoteIf you are working with a conditionally executed subsystem Outport block, Simulink generates a warning that the initial value of the signal object has been ignored. |
Check for library blocks with instances that have warnings. | Examine the warning subcheck results for each block before migrating to the simplified initialization mode. |
Check for merged Outport blocks that are either unconnected or connected to a Ground block. | Verify that the following behavior is acceptable.The Outport block is driving aMerge block, but its inputs are either unconnected or connected to Ground blocks. In the classic initialization mode, unconnected or grounded output ports do not update the merge signal even when their parent conditionally executed subsystems are executing. In the simplified initialization mode, however, these output ports will update the merge signal with a value of zero when their parent conditionally executed subsystems are executing. |
Check for Outport blocks that obtain the Initial output value from an input signal when they are migrated. | Verify that the following behavior is acceptable.The Initial output parameter of theOutport block is not specified. As a result, the simplified initialization mode will assume that the Initial output value for theOutport block is derived from the input signal. This assumption may result in different initialization behavior.If this behavior is not acceptable, modify your model before you migrate to the simplified initialization mode. |
Check for outer Outport blocks that have an explicit Initial output. | Verify that the following behavior is acceptable.In classic initialization mode, theInitial output and Output when disabled parameters of theOutport block must match those of their source Outport blocks.In simplified initialization mode, Simulink sets the Initial output parameter of outer Outport blocks to [] (empty matrix) and Output when disabled parameter to held. |
Check for blocks that read input from conditionally executed subsystems during initialization. | Verify that the following behavior is acceptable.Some blocks, such as theDiscrete-Time Integrator block, read their inputs from conditionally executed subsystems during initialization in the classic initialization mode. Simulink performs this step as an optimization technique.This optimization is not allowed in the simplified initialization mode because the output of a conditionally executed subsystem at the first time step after initialization may be different than the initial value declared in the corresponding Outport block. In particular, this discrepancy occurs if the subsystem is active at the first time step. |
Check for a migration conflict for Outport blocks that use aDialog as the Source of initial output value. | Other instances of Outport blocks with the same library link either cannot be migrated or are being migrated in a different manner. Review the results from the to learn about the different migration paths for other instances of eachOutport block.TheOutport block will maintain its current settings and use its specified Initial output value. |
Check for a migration conflict for Outport blocks that useInput signal as theSource of initial output value. | Other instances of Outport blocks with the same library link either cannot be migrated or are being migrated in a different manner. Review the results from the to learn about the different migration paths for other instances of eachOutport block.TheOutport block currently specifies anInitial output of[] (empty matrix), and the Output when disabled asheld. This means that each output port does not perform initialization, but implicitly relies on source blocks to initialize its input signal.After migration, the parameter Source of initial output value will be set toInput signal to reflect this behavior. |
Check for a migration conflict for Outport blocks that have SimEvents® semantics. | Other instances of Outport blocks with the same library link either cannot be migrated or are being migrated in a different manner. Review the results from the to learn about the different migration paths for other instances of eachOutport block.TheOutport blocks will continue to use anInitial output value of[] (empty matrix) and anOutput when disabled setting ofheld. Simulink will maintain these settings because their parent conditionally executed subsystems are connected to SimEvents blocks. |
Check for a migration conflict for innermost Outport blocks with variable-size input and unspecified Initial output. | For these Outport blocks, the signal size varies only when the parent subsystem of the block is re-enabled. Therefore, Simulink implicitly assumes that the Initial output parameter is equal to 0, even though the parameter is unspecified, []. Consequently, unless you specify the parameter, the Model Advisor will explicitly set the parameter to 0 when the model is migrated to the simplified initialization mode. Other instances of Outport blocks with the same library link either cannot be migrated or are being migrated in a different manner. Review the results from the to learn about the different migration paths for other instances of eachOutport block. |
Check for a migration conflict for Outport blocks that use a default ground value as the Initial output. | The parameter Initial output is set to[] (empty matrix) and the source of theOutport is an invalid initial condition source. Thus, the block uses the default initial value as the initial output in the simplified initialization mode. Other instances of Outport blocks with the same library link either have errors or are being migrated differently. |
Check for a migration conflict for merged Outport blocks without explicit specification of Initial output. | Review the results from the subcheck Check for library blocks with instances that cannot be migrated to learn about different migration paths for other instances of each Outport block. For the remaining Outport blocks, Initial output is set to [] (empty matrix) and Output when disabled is set toheld respectively, in simplified initialization mode. |
See Also
- Migrating to Simplified Initialization Mode Overview
- Model Advisor Exclusion Overview (Simulink Check)
Check usage of Discrete-Time Integrator blocks
Check ID:mathworks.design.DiscreteBlock
Identify Discrete-Time Integrator blocks with parameter settings that can lead to unexpected behavior, and help migrate your model to simplified initialization mode.
Description
Simplified initialization mode was introduced in R2008b to improve the consistency of simulation results. For more information, see Simplified Initialization Mode and Classic Initialization Mode.
This Model Advisor check identifies settings in Discrete-Time Integrator blocks in your model that can cause problems if you use the simplified initialization mode. It also recommends settings for consistent behavior of Discrete-Time Integrator blocks. The results of the subchecks contain two types of statements: Failed and Warning. Failed statements identify issues that you must address manually before you can migrate the model to the simplified initialization mode. Warning statements identify issues or changes in behavior that can occur after migration.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Check for Discrete-Time Integrator blocks whose parameter Initial condition setting is set to Output. | Determine if the new behavior of theDiscrete-Time Integrator blocks is acceptable. If it is not acceptable, modify the model to account for the new behavior before migrating to the simplified initialization mode. |
Check for Discrete-Time Integrator blocks whoseInitial condition setting parameter is set to State (most efficient) and are in a subsystem that uses triggered sample time. | Use periodic sample time for the block, or setInitial Condition setting toOutput. |
Check for blocks inside of the Iterator Subsystem that require elapsed time. | Within an Iterator Subsystem hierarchy, do not use blocks that require a service that maintains the time that has elapsed between two consecutive executions.Since an Iterator Subsystem can execute multiple times at a given time step, the concept of elapsed time is not well-defined between two such executions. Using these blocks inside of an Iterator Subsystem can cause unexpected behavior. |
See Also
- Migrating to Simplified Initialization Mode Overview
- Model Advisor Exclusion Overview (Simulink Check)
Check model settings for migration to simplified initialization mode
Check ID:mathworks.design.ModelLevelMessages
Identify settings in Model blocks and model configuration parameters that can lead to unexpected behavior, and help migrate your model to simplified initialization mode.
Description
Simplified initialization mode was introduced in R2008b to improve consistency of simulation results. For more information, see Simplified Initialization Mode and Classic Initialization Mode.
This Model Advisor check identifies issues in the model configuration parameters and Model blocks in your model that can cause problems when you migrate to simplified initialization mode. The results of the subchecks contain two types of statements: Failed and Warning. Failed statements identify issues that you must address manually before you can migrate the model to simplified initialization mode. Warning statements identify issues or changes in behavior that can occur after migration.
After running this Model Advisor consistency check, if you clickExplore Result button, the messages pertain only to blocks that are not library-links.
Note
Because it is difficult to undo these changes, select > to back up your model before migrating to the simplified initialization mode.
For more information, see Model Configuration Parameters: Connectivity Diagnostics.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Verify that all Model blocks are using the simplified initialization mode. | Migrate the model referenced by the Model block to the simplified initialization mode, then migrate the top model. |
Verify simplified initialization mode setting | Set > toSimplified. |
Action Results
Clicking Modify Settings causes the following:
- The Model parameter is set to
simplified
- If an Outport block has the Initial output parameter set to the empty character vector,
[]
, then theSourceOfInitialOutputValue
parameter is set to . - If an Outport has an empty Initial output and a variable-size signal, then the Initial output is set to zero.
See Also
- Migrating to Simplified Initialization Mode Overview
- Model Advisor Exclusion Overview (Simulink Check)
Simulation Accuracy Overview
Use the Simulation Accuracy Model Advisor checks to configure your model for accuracy considerations.
See Also
- Run Model Advisor Checks
- Model Advisor Checks (Simulink Coder)
- Simulink Check Checks (Simulink Check)
Check S-functions in the model
Check ID:mathworks.design.SFuncAnalyzer
Perform quality checks on S-functions in Simulink models or subsystems.
Description
The S-function analyzer performs quality checks on S-functions to identify improvements and potential problems in the specified model. The checks displays an error when the build dependency cannot be automatically derived, for example, when the source code is not in the current folder.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Continuous states are modified inmdlOutputs method. | Modify Continuous States at a major time step and usessSetSolverNeedsReset function in S-function code. |
Continuous states are modified in themdlUpdate method. | Modify Continuous States only at a major time step and usessSetSolverNeedsReset function in S-function code. |
S-function discrete states are modified in themdlOutputs at a minor step. | Modify the discrete states only at a major step guarded byssIsMajorTimeStep function. |
S-function mode vector is modified in themdlOutputs method at a minor step. | Modify the mode vector only at a major step guarded bysslsMajorTimeStep function. |
S-function is using static or global variables to declare internal states. | Declare the states explicitly usingssSetNumDiscStates function or Model Global Data by Creating Data Stores. |
S-function has continuous states but sample time is not declared continuous. | Specify continuous sample time usingssSetSampleTime function. |
S-function has discrete states but themdlOutputs andmdlUpdate methods are combined. | Define the mdlOutputs andmdlUpdate methods separately and modify discrete states only in mdlUpdate method. |
S-function sets theSS_OPTION_CAN_BE_CALLED_CONDITIONALLY option when having state-like data or multiple sample times. | Remove the options when the S-function has state-like data or multiple sample times. |
MEX compilers do not exist on the machine. | Check for the presence or install MEX compilers on the machine. |
S-function encounters errors while compiling the model. | Check the Diagnostic Viewer output and recompile the model. |
Check for non-continuous signals driving derivative ports
Check ID:mathworks.design.NonContSigDerivPort
Identify noncontinuous signals that drive derivative ports.
Description
Noncontinuous signals that drive derivative ports cause the solver to reset every time the signal changes value, which slows down simulation.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
There are noncontinuous signals in the model driving derivative ports. | Make the specified signals continuous.Replace the continuous blocks receiving these signals with discrete state versions of the blocks. |
Capabilities and Limitations
If you have a Simulink Check license, you can exclude blocks and charts from this check.
See Also
- Simulink Models
- Simulation Phases in Dynamic Systems
- Model Advisor Exclusion Overview (Simulink Check)
Simulation Runtime Accuracy Diagnostics Overview
Use the Simulation Runtime Accuracy Diagnostics Model Advisor checks to configure your model for simulation accuracy diagnostics that can help find problems, but slows simulations.
See Also
- Run Model Advisor Checks
- Model Advisor Checks (Simulink Coder)
- Simulink Check Checks (Simulink Check)
Runtime diagnostics for S-functions
Check ID:mathworks.design.DiagnosticSFcn
Check array bounds and solver consistency if S-Function blocks are in the model.
Description
Validates whether S-Function blocks adhere to the ODE solver consistency rules that Simulink applies to its built-in blocks.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Solver data inconsistency is set tonone. | In the Configuration Parameters dialog box, setSolver data inconsistency towarning orerror. |
Array bounds exceeded is set tonone. | In the Configuration Parameters dialog box, setArray bounds exceeded towarning orerror |
Capabilities and Limitations
If you have a Simulink Check license, you can exclude blocks and charts from this check.
See Also
- What Is an S-Function?
- How S-Functions Work
- Model Advisor Exclusion Overview (Simulink Check)
Identify unit mismatches in the model
Check ID:mathworks.design.UnitMismatches
Identify instances of unit mismatches between ports in the model and between model argument values and definitions.
Description
Check for instances of unit mismatches between:
- Ports in the model
- Model argument values and definitions
To detect and report warnings for mismatched units on model arguments, you must set the simulation mode of Model blocks to normal mode.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Unit mismatches found | Change one of the mismatched unit settings to match the unit settings for the other port. |
See Also
Identify automatic unit conversions in the model
Check ID:mathworks.design.AutoUnitConversions
Identify instances of automatic unit conversions in the model.
Description
Identify instances of automatic unit conversions in the model.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Automatic unit conversions found | Check that the converted units are expected for the model. |
See Also
Identify disallowed unit systems in the model
Check ID:mathworks.design.DisallowedUnitSystems
Identify instances of disallowed unit systems in the model.
Description
Identify instances of disallowed unit systems in the model.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Disallowed unit systems found | Either choose a unit that conforms to the configured unit system, or select another unit system. For more information, seeRestricting Unit Systems. |
See Also
Identify undefined units in the model
Check ID:mathworks.design.UndefinedUnits
Identify instances of unit specifications, not defined in the unit database, in the model.
Description
Identify instances of unit specifications, not defined in the unit database, in the model.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Undefined units found | Change the unit to one that Simulink supports. |
See Also
Identify ambiguous units in the model
Check ID:mathworks.design.AmbiguousUnits
Identify instances of ambiguous unit specifications, such as duplicate unit names in the unit database, in the model.
Description
Identify instances of ambiguous unit specifications, such as duplicate unit names in the unit database, in the model.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Ambiguous units found | You can ignore the warning or specify the unit with corresponding unit system using the format_unit_system_::unit_name. |
See Also
Open the Upgrade Advisor
Check ID:com.mathworks.Simulink.UpgradeAdvisor.MAEntryPoint
This check provides access to the Upgrade Advisor.
Description
Run this check to access the Upgrade Advisor. Use the Upgrade Advisor for help with using the current release to upgrade and improve models. The Upgrade Advisor identifies cases where you can benefit by changing your model to use new features and settings in Simulink. The Advisor provides advice for transitioning to new technologies, and upgrading a model hierarchy.
The Upgrade Advisor also identifies cases when a model will not work because changes and improvements in Simulink require changes to a model.
The Upgrade Advisor offers options to perform recommended actions automatically or instructions for manual fixes.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Check for upgrade issues. | Click the link “Open the Upgrade Advisor” to close the Model Advisor and open the Upgrade Advisor for the current model. |
Tips
Alternatively, you can open the Upgrade Advisor in the following ways:
- From the Model Editor, in the Modeling tab, select > .
- From the MATLAB command line, use the
upgradeadvisor
function:
SeeProgrammatically Open Upgrade Advisor and Programmatically Analyze and Upgrade Model.
See Also
Check model for block upgrade issues
Check ID:mathworks.design.Update
Check for common block upgrade issues.
Description
Check blocks in the model for compatibility issues resulting from using a new version of Simulink software.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Blocks with compatibility issues found. | Click Modify to fix the detected block issues. |
Check update status for the Level 2 API S-functions. | Consider replacing Level 1 S-functions with Level 2. |
Action Results
Clicking Modify replaces blocks from a previous release of Simulink software with the latest versions.
See Also
Check model for block upgrade issues requiring compile time information
Check ID:mathworks.design.UpdateRequireCompile
Check for common block upgrade issues.
Description
Check blocks for compatibility issues resulting from upgrading to a new version of Simulink software. Some block upgrades require the collection of information or data when the model is in the compile mode. For this check, the model is set to compiled mode and then checked for upgrades.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Model contains Lookup Table or Lookup Table (2-D) blocks and some of the blocks specifyUse Input Nearest or Use Input Above for a lookup method. | Replace Lookup Table blocks and Lookup Table (2-D) blocks with n-D Lookup Table blocks. Do not apply Use Input Nearest or Use Input Above for lookup methods; select another option. |
Model contains Lookup Table or Lookup Table (2-D) blocks and some blocks perform multiplication first during interpolation. | Replace Lookup Table blocks and Lookup Table (2-D) blocks with n-D Lookup Table blocks. However, because the n-D Lookup Table block performs division first, this replacement might cause a numerical difference in the result. |
Model contains Lookup Table or Lookup Table (2-D) blocks. Some of these blocks specify Interpolation-Extrapolation as the Lookup method but their input and output are not the same floating-point type. | Replace Lookup Table blocks and Lookup Table (2-D) blocks with n-D Lookup Table blocks. Then change the extrapolation method or the port data types for block replacement. |
Model contains Unit Delay blocks withSample time set to-1 that inherit a continuous sample time. | Replace Unit Delay blocks withMemory blocks. |
Check Data Store Memory blocks for multitasking
Action Results
Clicking Modify replaces blocks from a previous release of Simulink software with the latest versions.
See Also
Check if SLX file compression is off
Check ID:mathworks.design.CheckSLXFileCompressionLevel
Check if SLX file compression is turned off to reduce Git™ repository size.
Description
Check whether compression for the SLX model is turned off.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Model, library, or subsystem is saved in SLX format. File compression is turned on. | Consider turning off file compression to optimize storage under source control. |
Capabilities and Limitations
You can run this check on models, libraries, and subsystems checked in to Git source control.
See Also
Check that the model or library is saved in current version
Check ID:mathworks.design.CheckSavedInCurrentVersion
Check that the model, library, or subsystem is saved in the current version of Simulink.
Description
Check whether the model file is saved in the current Simulink release.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Model, library, or subsystem not saved in the current version of Simulink. | Consider saving the model file in the current version of Simulink. |
Capabilities and Limitations
You can run this check on your models, libraries, and subsystems.
Tips
Projects can help you save all the models and libraries in your project to the current Simulink release. See Check for Compatibility Issues and Upgrade Simulink Models Using Project Upgrade.
See Also
- Upgrade Models Using Upgrade Advisor.
- Model Upgrades
- Check for Compatibility Issues and Upgrade Simulink Models Using Project Upgrade
Check model for SB2SL blocks
Check ID:mathworks.simulink.SB2SL.Check
Check that the model does not have outdated SB2SL blocks.
Description
Check if the model contains outdated SB2SL blocks.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Model contains outdated SB2SL blocks | Consider upgrading the model to current SB2SL blocks. |
Action Results
Clicking Update SB2SL Blocks replaces blocks with the latest versions.
See Also
Check for import custom code
Check ID:mathworks.stateflow.ImportCustomCode.check
Description
Check if the model imports custom code.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
The Import custom code option is cleared. | Consider checking the Import custom code option and saving the model file in the current version of Simulink. |
Action Results
Selecting the Import custom code option enables the Simulink model to import custom code.
See Also
Check Model History properties
Check ID:mathworks.design.SLXModelProperties
Check for edited model history properties
Description
Check models for edited Model History property values that could be used with source control tool keyword substitution. This keyword substitution is incompatible with SLX file format.
In the MDL file format you can configure some model properties to make use of source control tool keyword substitution. If you save your model in SLX format, source control tools cannot perform keyword substitution. Information in the model file from such keyword substitution is cached when you first save the MDL file as SLX, and is not updated again. The Model Properties History pane and Model Info blocks in your model show stale information from then on.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Edited model history properties | Manually or automatically reset the properties to the default values. Click the button to reset, or to inspect and change these properties manually, open the Model Properties dialog box and look in the History pane. |
Capabilities and Limitations
You can run this check on your library models.
See Also
Identify Model Info blocks that can interact with external source control tools
Check ID:mathworks.design.ModelInfoKeywordSubstitution
Use this check to find Model Info blocks that can be altered by external source control tools through keyword substitution.
Description
This check searches for character vectors in the Model Info block enclosed within dollar signs that can be overwritten by an external source control tool. Using third-party source control tool keyword expansion might corrupt your model files when you submit them. Keyword substitution is not available in SLX model file format.
For a more flexible interface to source control tools, use a Simulink project instead of the Model Info block. See Use Source Control with MATLAB Projects.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
The Model Info block contains fields like this:$keyword$ | Review the list of fields in the report, then remove the keyword character vectors from the Model Info block. |
See Also
Check model for upgradable SerDes Toolbox blocks
Check ID:mathworks.design.serdesUpgrades
Lists blocks saved in a previous version of SerDes Toolbox™ that are outdated.
Description
This check searches for and lists SerDes Toolbox blocks that can be upgraded for compatibility with the current release.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Blocks saved in older versions of SerDes Toolbox are found. | Click Upgrade SerDes Toolbox Blocks to upgrade the SerDes Toolbox blocks to be compatible with the current release. |
Action Results
Clicking Upgrade SerDes Toolbox Blocks upgrades the outdated SerDes Toolbox blocks to be compatible with the current release.
See Also
- Design and Simulate SerDes Systems (SerDes Toolbox)
Check model for legacy 3DoF or 6DoF blocks
Check ID:mathworks.design.Aeroblks.CheckDOF
Lists 3DoF and 6DoF blocks are outdated.
Description
This check searches for 3DoF and 6DoF blocks from library versions prior to 3.13 (R2014a).
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Blocks configured with old versions of 3DoF or 6DoF blocks found. | Click Replace 3DoF and 6DoF Blocks to replace the blocks with latest versions. |
Action Results
Clicking Replace 3DoF and 6DoF Blocks replaces blocks with the latest versions.
See Also
- Equations of Motion (Aerospace Blockset)
Check model for Aerospace Blockset navigation blocks
Check ID:mathworks.design.Aeroblks.CheckNAV
Searches for Three-Axis Inertial Measurement Unit, Three-Axis Gyroscope, and Three-Axis Accelerometer blocks prior to 3.21 (R2018a).
Description
This check searches for Three-Axis Inertial Measurement Unit, Three-Axis Gyroscope, and Three-Axis Accelerometer blocks that have been updated in R2018a.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Three-Axis Inertial Measurement Unit, Three-Axis Gyroscope, and Three-Axis Accelerometer blocks prior to R2018a. | In R2018a or later, if you did not previously solve for steady state conditions, save the model now. If you previously solved for steady state conditions for the model, solve for these steady state conditions again, and then save the model. |
See Also
- Three-axis Accelerometer (Aerospace Blockset)
- Three-axis Gyroscope (Aerospace Blockset)
- Three-axis Inertial Measurement Unit (Aerospace Blockset)
Check and update masked blocks in library to use promoted parameters
Check ID:mathworks.design.CheckAndUpdateOldMaskedBuiltinBlocks
Check for libraries that should be updated to use promoted parameters.
Description
This check searches libraries created before R2011b for masked blocks that should be updated to use promoted parameters. Since R2011b, if a block parameter is not promoted, its value in the linked block is locked to its value in the library block. This check excludes blocks of type Subsystem, Model reference, S-Function and M-S-Function.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Libraries that need to be updated are found | Click Update. Once the libraries have been updated, run the check again. |
Capabilities and Limitations
You can:
- Run this check on your library models.
- Exclude blocks and charts from this check if you have aSimulink Check license.
See Also
- Upgrade Models Using Upgrade Advisor.
- Model Upgrades
- Model Advisor Exclusion Overview (Simulink Check)
Check and update mask image display commands with unnecessary imread()
function calls
Check ID:mathworks.design.CheckMaskDisplayImageFormat
Check identifies masks using image display commands with unnecessary calls to theimread()
function.
Description
This check searches for the mask display commands that make unnecessary calls to the imread()
function, and updates them with mask display commands that do not call the imread()
function. Since 2013a, a performance and memory optimization is available for mask images specified using the image path instead of the RGB triple matrix.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Mask display commands that make unnecessary calls to theimread() function are found. | Click Update. Once the blocks have been updated, run the check again. |
Capabilities and Limitations
You can:
- Run this check on your library models.
- Exclude blocks and charts from this check if you have aSimulink Check license.
See Also
- Upgrade Models Using Upgrade Advisor.
- Model Upgrades
- Model Advisor Exclusion Overview (Simulink Check)
Check and update mask to affirm icon drawing commands dependency on mask workspace
Check ID:mathworks.design.CheckMaskRunInitFlag
Check identifies if the mask icon drawing commands have dependency on the mask workspace.
Description
This check identifies if the mask icon drawing commands have dependency on the mask workspace and updates the RunInitForIconRedraw
property accordingly. If there is no mask workspace dependency, the value ofRunInitForIconRedraw
is set to off
, whereas, if there is mask workspace dependency the values is set toon
.
Setting the values of RunInitForIconRedraw
tooff
when there is no mask workspace dependency optimizes the performance by not executing the mask initialization code before drawing the block icon.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Mask drawing commands that are dependent or independent of the mask workspace are found. | Click Update. Once the blocks have been updated, run the check again. |
Capabilities and Limitations
You can:
- Run this check on your library models.
- Exclude blocks and charts from this check if you have aSimulink Check license.
See Also
- Upgrade Models Using Upgrade Advisor.
- Model Upgrades
- Model Advisor Exclusion Overview (Simulink Check)
Identify masked blocks that specify tabs in mask dialog box using MaskTabNames
parameter
Check ID:mathworks.design.CheckAndUpdateOldMaskTabnames
This check identifies masked blocks that specify tabs in mask dialog box using theMaskTabNames
parameter.
Description
This check identifies masked blocks that use theMaskTabNames
parameter to programmatically create tabs in the mask dialog box. Since R2013b, dialog box controls are used to group parameters in a tab on the mask dialog box.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Masked blocks that use the MaskTabNames parameter to create tabs programmatically in the mask dialog box are found. | Click Upgrade available in theAction section. Once the blocks have been updated, run the check again. |
Capabilities and Limitations
You can run this check on your library models.
See Also
Identify questionable operations for strict single-precision design
Check ID:mathworks.design.StowawayDoubles
For a strict single-precision design, this check identifies the blocks that introduce double-precision operations, and non-optimal model settings.
Description
For a strict single-precision design, this check identifies the blocks that introduce double-precision operations, and non-optimal model settings.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Double-precision floating-point operations found in model. | Verify that: Block input and output data types are set correctly.In the Configuration Parameters dialog box,Default for underspecified data type is set tosingle. |
Model uses a library standard that is not optimal for strict-single designs. | Verify that:All target-specific math libraries used by the model support single-precision implementations.Set > to C99 (ISO). |
Logic signals are not implemented as Boolean data. | Verify that:In the Configuration Parameters dialog box,Implement logic signals as Boolean data is selected. |
Capabilities and Limitations
If you have a Simulink Check license, you can exclude blocks and charts from this check.
See Also
- Validate a Floating-Point Embedded Model
- Upgrade Models Using Upgrade Advisor.
- Model Upgrades
- Model Advisor Exclusion Overview (Simulink Check)
Check get_param
calls for block CompiledSampleTime
Check ID:mathworks.design.CallsGetParamCompiledSampleTime
Use this check to identify MATLAB files in your working environment that containget_param
function calls to return the blockCompiledSampleTime
parameter.
Description
For multi-rate blocks (including subsystems), Simulink returns the block compiled sample time as a cell array of the sample rates in the block. The return value is a cell array of pairs of doubles. MATLAB code that accepts this return value only as pairs of doubles can return an error when called with a multi-rate block. Use this check to identify such code in your environment. Modify these instances of code to accept a cell array of pairs of doubles instead.
For example, consider a variable blkTs
, which has been assigned the compiled sample time of a multi-rate block.
blkTs = get_param(block,'CompiledSampleTime');
Here are some examples in which the original code works only ifblkTs
is a pair of doubles and the block is a single-rate block:
- Example 1
if isinf(blkTs(1))
disp('found constant sample time')
end
SinceblkTs
is now a cell array, Simulink gives this error message:
Undefined function 'isinf' for input arguments of type 'cell'
Instead, use this code, for whichblkTs
can be a cell array or a pair of doubles.
if isequal(blkTs, [inf,0])
disp('found constant sample time')
end - Example 2
if all(blkTs == [-1,-1])
disp('found triggered sample time')
end
For the above example, sinceblkTs
is now a cell array, Simulink gives this error:
Undefined function 'eq' for input arguments of type 'cell'
Instead, use this code, for whichblkTs
can be a cell array or a pair of doubles.
if isequal(blkTs, [-1,-1])
disp('found triggered sample time')
end - Example 3
if (blkTs(1) == -1)
disp('found a triggered context')
end
Again, sinceblkTs
is now a cell array, Simulink gives this error:
Undefined function 'eq' for input arguments of type 'cell'
Instead, use this code.
if ~iscell(blkTs)
blkTs = {blkTs};
end
for idx = 1:length(blkTs)
thisTs = blkTs{idx};
if (thisTs(1) == -1)
disp('found a triggered context')
end
end
The above code checks for a triggered type sample time (triggered or asynchronous). In cases in which a block has constant sample time ([inf,0]) in addition to triggered or asynchronous or when a block has multiple asynchronous rates, this alternative property detects the triggered type sample time.
This check scans MATLAB files in your environment. If the check finds instances of MATLAB code that contain get_param
calls to output the block compiled sample time, Upgrade Advisor displays these results. It suggests that you modify code that accepts the block compiled sample time from multi-rate blocks.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
No MATLAB files callget_param(block,CompiledSampleTime) | None |
Some MATLAB files callget_param(block,CompiledSampleTime) | If files use the block CompiledSampleTime parameter from multi-rate blocks, modify these files to accept the parameter as a cell array of pairs of doubles |
See Also
Check if all simulation outputs are returned as a single Simulink.SimulationOutput
object
Check ID:mathworks.design.CheckSingleSimulationOutput
Use this check to identify if the simulation result is returned as a singleSimulink.SimulationOutput
object.
Description
This check scans your model to verify if the parameterReturnWorkspaceOutputs
is enabled. Enabling this parameter, returns simulation outputs in aSimulink.SimulationOutput
when simulating interactively. Simulation outputs include signal, state, output, DSM logging, and scope andTo Workspace
block logging.
When ReturnWorkspaceOutputs
is enabled, it provides:
- Easier management of simulation data.
- Automatic access to
SimulationMetadata
. - Compatibility with multiple parallel simulations and batch simulations.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Simulation outputs are not returned as a single Simulink.SimulationOutput object | Return all simulation outputs as a singleSimulink.SimulationOutput object |
See Also
Check model for parameter initialization and tuning issues
Check ID:mathworks.design.ParameterTuning
Use this check to identify issues in the model that occur when you initialize parameters or tune them.
Description
This check scans your model for parameter initialization and tuning issues like:
- Rate mismatch between blocks
- Divide by zero issue in conditionally executed subsystems
- Invalid control port value in Index Vector blocks
Results and Recommended Actions
Condition | Recommended Action |
---|---|
The model has rate transition issues. | Select Automatically handle rate transition for data transfer in theSolver pane of the model configuration parameters. |
The model has a divide by zero issue in a conditionally executed subsystem with a control port. | At the command prompt, runset_param(control_port,'DisallowConstTsAndPrmTs', 'on') |
The model has an invalid control port value in a conditionally executed subsystem. | At the command prompt, runset_param(control_port,'DisallowConstTsAndPrmTs', 'on') |
Action Results
Select Upgrade model to resolve issues in the model related to parameter initialization and tuning.
See Also
Check for virtual bus across model reference boundaries
Check ID:mathworks.design.CheckVirtualBusAcrossModelReference
Check virtual buses that cross model reference boundaries.
Description
This Upgrade Advisor check identifies root Inport andOutport blocks that have these issues at model reference boundaries:
- Incompatible virtual buses
- Large virtual buses that can slow performance (since R2024b)
This check also identifies the Model blocks that correspond with the affected Outport blocks.
Using nonvirtual buses instead of virtual buses resolves the issues.
Results and Recommended Actions
Tip
Run this check for all levels in the model reference hierarchy using theAnalyze model hierarchy and continue upgrade sequence check.
Condition | Recommended Action |
---|---|
Root Inport blocks receive incompatible or large virtual buses as input. | ClickUpgrade Model to selectOutput as nonvirtual bus for theInport blocks and to insert Signal Conversion blocks that restore the virtual buses. |
Root Outport blocks receive incompatible or large virtual buses as input. | ClickUpgrade Model to selectOutput as nonvirtual bus in parent for the Outport blocks. |
Model blocks reference models that contain root Outport blocks that receive incompatible or large virtual buses as input. | ClickUpgrade Model to insertSignal Conversion blocks after theModel blocks, converting nonvirtual buses to virtual buses as necessary.The software inserts a Signal Conversion block after eachModel block port whoseOutport block was updated to address issues. The Signal Conversion block is configured to output a virtual bus. |
For root-level Inport and Outport blocks that receive incompatible virtual buses, the conversion happens in models where you:
- Use function prototype control.
- Perform C++ code generation with the
I/O arguments step method
option.
To change the C++ code generation function specification setting toDefault step method
:- In the > > pane, click Configure C++ Class Interface.
- In the dialog box, set the Function specification parameter to
Default step method
.
- Use buses that have variable-dimension signals.
- Use an associated non-auto storage class forOutport block signals.
The conversion for non-auto storage class occurs only if you have the target generation license that the model requires. For example, an ERT target requires an Embedded Coder license. - Use export-function models where an Outport block is driven by a nonvirtual bus.
- Have Model blocks that reference models containingOutport blocks that have been fixed.
See Also
- Upgrade Models Using Upgrade Advisor
- Simplify Subsystem and Model Interfaces with Bus Element Ports
- Use Buses at Model Interfaces
Check model for custom library blocks that rely on frame status of the signal
Check ID:mathworks.design.DSPFrameUpgrade
This check identifies custom library blocks in the model that depend on the frame status of the signal.
Description
This check searches for the custom library blocks in a model that depend on the frame status of the signal. The check analyzes the blocks, recommends fixes, and gives reasons for the fixes. You must make the fixes manually.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
The check finds custom library blocks that depend on the frame status of the signal. | Follow the recommendation given by the Upgrade Advisor. |
Capabilities and Limitations
You can run this check only on custom library blocks in your model.
You must make the fixes manually.
This check appears only if you have the DSP System Toolbox™ installed.
Check model for S-function upgrade issues
Check ID:'mathworks.design.CheckForSFcnUpgradeIssues'
Use this check on your model to identify your S-function's upgrade compatibility issues. These issues may include the use of 32-bit APIs, compilation with incompatible options, or use of deprecated separate complex APIs. Some common issues and information related to the fixes are described in results and recommendations section below.
Description
When upgrading your S-functions to use the features in the latest release, this check scans your model to warn against S-function upgrade incompatibility issues. If the result of this check gives a warning or error, fix your C MEX S-functions according to the description.
Results and Recommended Actions
See Also
Update System object syntax
Check ID:'mathworks.design.CheckSystemObjectUpdate'
Use this check to identify and update any custom MATLAB System object™ in your model that have outdated syntax.
Description
This check scans your model to identify outdated System object syntax. If the check passes, all the syntax is up to date. If the check fails, you can update the syntax.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
System object syntax is up to date. | None. |
System object syntax requires update. | A report is generated for each unique System object associated with a MATLAB System block. Use Update to update the syntax. |
See Also
Check Rapid accelerator signal logging
Check ID:mathworks.design.CheckRapidAcceleratorSignalLogging
When simulating your model in rapid accelerator mode, use this check to find signals logged in your model that are globally disabled. Rapid accelerator mode supports signal logging. Use this check to enable signal logging globally.
Description
This check scans your model to see if a simulation is in rapid accelerator mode and whether the model contains signals with signal logging. If the check finds an instance and signal logging is globally disabled, an option to turn on signal logging globally appears.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Simulation mode is not rapid accelerator. | None. You can enable signal logging in rapid accelerator mode. |
Simulation mode is rapid accelerator. Upgrade Advisor did not find signals with signal logging enabled. | None. The model does not use signal logging. Enable signal logging for signals and globally if you want to log signals. |
Simulation mode is rapid accelerator. Upgrade Advisor found signals with signal logging enabled. However, global setting for signal logging was disabled. | Enable signal logging globally if you want to log signals with signal logging enabled. |
Signal logging was already globally enabled. | None. |
Action Results
Selecting Modify enables signal logging globally in your model.
See Also
Check virtual bus inputs to blocks
Check ID:mathworks.design.VirtualBusUsage
Check bus input signals for a set of blocks.
Description
Check bus input signals for a set of blocks.
Starting in R2015b, virtual bus inputs to blocks that require nonbus or nonvirtual bus input can cause an error. Examples of blocks that can specify a bus object as their output data type include a Bus Creator block and a root Inport block. The blocks that cause an error when they have a virtual bus input in this situation are:
- Assignment
- Delay
The Delay block causes an error only if you use the Block Parameters dialog box to:- Set an initial condition that is a MATLAB structure or zero.
- Specify a value for State name.
- Permute Dimension
- Reshape
- Selector
- Unit Delay
The Unit Delay block causes an error only if you use the Block Parameters dialog box to:- Set an initial condition that is a MATLAB structure or zero.
- Specify a value for State name.
- Vector Concatenate
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Virtual bus input to these blocks:AssignmentDelay (if you specify an initial condition from the dialog box that is a MATLAB structure or zero and the value forState name is not empty)Permute DimensionReshapeSelectorUnit Delay (if you specify an initial condition that is a MATLAB structure or zero and the value forState name is not empty)Vector Concatenate | In the Upgrade Advisor, clickModify.The check inserts a Bus to Vector block to attempt to convert the virtual buses to vectors. For issues that the Upgrade Advisor identifies but cannot fix, modify the model manually. For details, see Identify Automatic Bus Conversions. |
Action Results
Clicking Modify inserts a Bus to Vector block at the input ports of blocks.
For many models, running the Upgrade Advisor modifies your model so that buses are not treated as vectors. However, for some models you can encounter compatibility issues even after running the check. Modify your model manually to address those issues.
After you compile the model using Upgrade Advisor, the Simulink Editor sometimes indicates that you need to save the model (the model is dirty), even though you did not make changes. To prevent this issue from reoccurring for this model, save the model.
Modeling Pattern | Issue | Solution |
---|---|---|
Data Store Memory block withData Type set toInherit: auto | A Data Store Memory block whose associated Data Store Read or Data Store Write blocks read or write bus data must use a bus object. | In the Data Store Memory block, set theData Type signal attribute toBus: . |
Signal Conversion blockOutput parameter matches input bus type | A Signal Conversion block whoseOutput parameter is set toNonvirtual bus requires a virtual bus input.A Signal Conversion block whoseOutput parameter is set toVirtual bus requires a nonvirtual bus input. | To create a copy of the input signal, setOutput to Signal copy. |
Merge, Switch, orMultiport Switch block with multiple bus inputs | Merge, Switch, orMultiport Switch blocks with multiple bus inputs require those inputs to have the same names and hierarchy. | Reconfigure the model so that the bus inputs have the same names and hierarchy. |
Root Inport block outputting a virtual bus and specifying a value for Port dimensions | A root Inport block that outputs to a virtual bus must inherit the dimensions. | Set the Inport block Port dimensions signal attribute to1 or -1 (inherit). |
Mux block with nonvirtual bus inputs | A Mux block cannot accept nonvirtual buses. | To treat the output as an array, replace theMux block with a Vector Concatenate block.If you want a virtual bus output, use a Bus Creator block to combine the signals. |
Bus to Vector block without a virtual bus input | A nonbus signal does not need a Bus to Vector block. | Remove the Bus to Vector block. |
Assignment block with virtual bus inputs | The Upgrade Advisor converts theAssignment block Y0 port bus input to a vector. | Add a Bus to Vector block before theAssignment block. |
S-function using a nonvirtual bus | An S-function that is not a Level-2 C S-function does not support nonvirtual buses. | Change the S-function to be a Level-2 C S-function.Consider using an S-Function Builder block to create a Level-2 C S-function. |
Stateflow chart with parameterized data type | In a Stateflow chart, you cannot parameterize the data type of an input or output in terms of another input or output if the data type is a bus object. | For the parameterized port, set Data Type to Bus: . |
Subsystem with bus operations in a Stateflow chart | An Inport block inside a subsystem in a Stateflow chart requires a bus object data type if its signal is a bus. | In the Inport block, set Data type to Bus: . |
Ground block used as a bus source | The output signal of a Ground block cannot be a source for a bus. | Use a Constant block withConstant value set to 0 and theOutput data type signal attribute set to Bus: . |
Root Outport block with a single-element bus object data type | The input to the Outport block must be a bus if it specifies a bus object as its data type. | In the Outport block, set Data type to Inherit: auto. |
See Also
- Bus to Vector block
- Identify Automatic Bus Conversions
- Migrating to Simplified Initialization Mode Overview
- Simulink.BlockDiagram.addBusToVector
Check for root outports with constant sample time
Check ID:mathworks.design.CheckConstRootOutportWithInterfaceUpgrade
Use this check to identify root output ports with a constant sample time used with an AUTOSAR target, Function Prototype Control, or the model C++ class interface.
Description
Root output ports with constant sample time are not supported when using an AUTOSAR target, Function Prototype Control, or the model C++ class interface. Use this check to identify root Outport blocks with this condition and modify the blocks as recommended.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Root output port with constant sample time used with an AUTOSAR target, Function Prototype Control or the model C++ class interface. | Consider one of the following:Set the sample time of the block to the fundamental sample time.Identify the source of the constant sample time and set its sample time to the fundamental sample time.Place a Rate Transition block with inherited sample time (-1) before the block. |
See Also
Analyze model hierarchy and continue upgrade sequence
Check ID:com.mathworks.Simulink.UpgradeAdvisor.UpgradeModelHierarchy
Check for child models and guide you through upgrade checks.
Description
This check identifies child models of this model, and guides you through upgrade checks to run both non-compile and compile checks. The Advisor provides tools to help with these tasks:
- If the check finds child models, it offers to run the Upgrade Advisor upon each child model in turn and continue the upgrade sequence. If you have a model hierarchy you need to check and update each child model in turn.
- If there are no child models, you still need to continue the check sequence until you have run both non-compile and compile checks.
You must run upgrade checks in this order: first the checks that do not require compile time information and do not trigger an Update Diagram, then the compile checks.
Click Continue Upgrade Sequence to run the next checks. If there are child models, this will open the next model. Keep clicking Continue Upgrade Sequence until the check passes.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Child models found | Click Continue Upgrade Sequence to run the next checks. If there are child models, this will close the current Upgrade Advisor session, and open Upgrade Advisor for the next model in the hierarchy. |
No child models, but more checks to run | If there are no child models, clickContinue Upgrade Sequence to refresh the Upgrade Advisor with compilation checks selected. The compile checks trigger an Update Diagram (marked with_^_). Run the next checks and take advised actions. When you return to this check, click Continue Upgrade Sequence until this check passes. |
Tips
Best practice for upgrading a model hierarchy is to check and upgrade each model starting at the leaf end and working up to the root model.
When you click Continue Upgrade Sequence, the Upgrade Advisor opens the leaf model as far inside the hierarchy as it can find. Subsequent steps guide you through upgrading your hierarchy from leaf to root model.
When you open the Upgrade Advisor, the checks that are selected do not require compile time information and do not trigger an Update Diagram. Checks that trigger an Update Diagram are not selected to run by default, and are marked with ^
. When you use the Upgrade Advisor on a hierarchy, keep clicking Continue Upgrade Sequence to move through this sequence of analysis:
- The Upgrade Advisor opens each model and library in turn, from leaf to root, and selects the non-compile checks. Run the checks, take any advised actions, then click Continue Upgrade Sequence to open the next model and continue.
- When you reach the root end of the hierarchy, the Upgrade Advisor then opens each model again in the same order (but not libraries) and selects only the checks that require a model compile. Run the checks, take any advised actions, then click Continue Upgrade Sequence to open the next model. Continue until you reach the end of the hierarchy and this check passes.
See Also
Check Access to Data Stores
Check ID:mathworks.design.ConflictsForDataStoreReadWriters
Identify potential execution order sensitivity when reading and writing to data stores.
Description
The execution order of blocks that read and write to the same data store can change the simulation result. When blocks in the same hierarchy access the same data store, the execution order is not deterministic.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Data Store Memory block accessed by multiple blocks in the same hierarchy. | To enforce execution order for the blocks, consider the following:Add a data dependency between the blocks.Set block priority.Move blocks into separate Function-Call Subsystem blocks and schedule them. |
See Also
Check relative execution orders for Data Store Read and Data Store Write blocks
Check ID:mathworks.design.TaskBasedSorting
Check relative execution order changes between legacy and task-based sorting for Data Store Read and Data Store Write blocks.
Description
Legacy models used block sorting to determine block execution order. With task-based sorting, the relative execution order involving Data Store Memory blocks can change. This check detects the changes and provides an option to update your model with the original execution order.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Execution order with a Data Store Memory block changes. You want the original execution order. | Click the Modify button. |
See Also
Check for case mismatches in references to models and libraries
Check ID:mathworks.design.CaseSensitiveBlockDiagramNames
Identify and fix case-insensitive references to models and libraries.
Description
Starting R2020a, Simulink model and library names are case-sensitive. This check detects and provides an option to fix case-insensitive references to models and libraries.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
The check finds case mismatches in references to models and libraries. | Follow the recommendation given by the Upgrade Advisor. |
See Also
Check model for Signal Builder blocks
Check ID:mathworks.design.Sigbldr.upgradeCheck
Searches for Signal Builder blocks in models.
Description
Find Signal Builder blocks in models and replace them with equivalently configured Signal Editor blocks.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Model contains one or more Signal Builder blocks. | To replace all Signal Builder blocks with equivalent Signal Editor blocks, click the associated link. |
See Also
Check output dimensions of MATLAB Function blocks
Check ID:mathworks.simulink.MLFBOutputDimensions
Check lists all the MATLAB Function blocks that have theInterpret output column vectors as one-dimensional data property enabled. If the property is enabled, the block converts output column vectors of size N-by-1 to one-dimensional signals with a signal size equal to N.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
MATLAB Function block produces one-dimensional output data and has property enabled | Clicking the Fix It button does not disable the property for the MATLAB function block. To disable the property: Select the MATLAB Function block.Open the Property Inspector. In theModeling tab, in theDesign section, clickProperty Inspector. In the General tab, clear the Interpret output column vectors as one-dimensional data property.Check the simulation behavior of the model, as disabling the property changes the size propagation of the MATLAB function block. |
MATLAB Function block does not produce one-dimensional data and has property enabled | Click the Fix It button to disable the property for the MATLAB function block. |
See Also
Check model for RF Blockset Divider blocks using Wilkinson power divider component with broken connections
Check ID:mathworks.design.rfblockset.ce.checkDisconnectedDividerBlocks
Search the model and list the RF Blockset™ Divider blocks using the Wilkinson power divider component with broken port connections on port 3.
Description
Starting R2021a, port positions of the RF Blockset Divider blocks using the Wilkinson power divider component are changed. This check searches and lists the Divider blocks using the Wilkinson power divider component model with broken port connections on port 3 prior to R2021a. You can then rewire the connections using the Modify button.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Models have RF Blockset Divider blocks using the Wilkinson power divider component with broken port connections on port 3. | Click the Modify button to rewire the broken connections on port 3 of the RF Blockset Divider blocks. |
Action Results
Clicking Modify rewires the broken port connections on port 3 of the RF Blockset Divider blocks.
Note
The Modify button will attempt to automatically rewire all the broken connections at port 3 of the Divider blocks using the Wilkinson power divider component in your model. To ensure accuracy, you must subsequently:
- Examine the details listed under the Result pane of the Upgrade Advisor.
- The first list enumerates the RF Blockset Divider blocks using the Wilkinson power divider component that require manual rewiring due to model complexity.
- The second list enumerates the automatically rewired blocks.
- Fixed and unfixed Divider blocks are temporarily highlighted in colors green and red, respectively. Click theRemove all temporary block highlighting link at the bottom of theResult pane to remove the highlights.
See Also
Identify Environment Controller Blocks and Replace Them with Variant Source Blocks
Check ID:mathworks.design.ReplaceEnvironmentControllerBlk
Search for Environment Controller blocks in the model.
Description
Find Environment Controller blocks in the model and replace them with Variant Source blocks with the Variant control mode parameter set to 'sim codegen switching'
.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Model contains one or more Environment Controller blocks. | Replace Environment Controller blocks withVariant Source blocks with theVariant control mode parameter set to'sim codegen switching'. |
Capabilities and Limitations
- You can run this check on your library models.
- You cannot use this check to identify Environment Controller blocks in referenced models and linked blocks.
See Also
Identify variant blocks with VariantActivation set to "Inherit From Simulink.VariantControl"
but does not useSimulink.VariantControl
Check ID:mathworks.simulink.InheritVATFromSlVarCtrlCheck
Identify variant blocks in the model that have no variant control variables of type Simulink.VariantControl
to inherit activation time.
Description
Identify variant blocks with Variant activation time set to inherit from Simulink.VariantControl
but no variant control variables of type Simulink.VariantControl
.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Variant block with inherit from Simulink.VariantControl activation time has no variant control variables of typeSimulink.VariantControl. | Change the type of at least one variant control variable toSimulink.VariantControl. |
Capabilities and Limitations
- You can run this check on your library models.
See Also
Replacing Blocks That Will Be Removed Overview
Checks to identify if the model contains any blocks that have been removed or will be removed in a future release.
See Also
Check for machine-parented data
Check ID:mathworks.stateflow.MachineParentedData.check
Check the model for instances of machine-parented data.
Description
Machine-parented data prevents models from reusing generated code and other code optimizations. Machine-parented data is also incompatible with many Simulink and Stateflow features. To make Stateflow data accessible to other charts and blocks in a model, use chart-parented data of scope Data Store Memory
. For more information, see Access Data Store Memory from a Chart (Stateflow).
Results and Recommended Actions
Condition | Recommended Action |
---|---|
A Simulink model contains Stateflow machine-parented data. | Upgrade the model by converting machine-parented data to chart-parented data with values in the model workspace. |
Action Results
Clicking Upgrade model creates chart-parented data in the charts that use machine-parented data.
- If a machine-parented data object has a scope of
Parameter
, the new chart-parented data object has a scope ofParameter
. The value is stored as a Simulink.Parameter object in the model workspace. - If a machine-parented data object has any other scope, the new chart-parented data object has a scope of
Data Store Memory
. The value is stored as a Simulink.Signal object in the model workspace.
Capabilities and Limitations
Automatic conversion fails when:
- The model workspace contains a
Simulink.Parameter
orSimulink.Signal
object with the same name as the machine-parented data. - The model contains chart-parented data, events, or messages with the same name as the machine-parented data.
- The machine-parented data uses Stateflow semantics that do not have an equivalent for
Simulink.Parameter
orSimulink.Signal
objects.
Tips
If your model contains a library chart or an atomic subchart linked from a library, you must upgrade every model that uses the library before you upgrade the library.
- Open and upgrade each top model that uses the library.
Upgrading the top model creates aSimulink.Parameter
orSimulink.Signal
object in the model workspace for each machine-parented data in the library. - Save and close the top models.
- Open and upgrade the library model.
Upgrading the library model creates chart-parented data that replaces the machine-parented data in the library. - Save and close the library model.
See Also
- Share Parameters with Simulink and the MATLAB Workspace (Stateflow)
- Access Data Store Memory from a Chart (Stateflow)
- Best Practices for Using Data in Charts (Stateflow)
- Upgrade Models Using Upgrade Advisor
Identify clones from the linked library
Check ID:mathworks.cloneDetection.libraryEdittime
Identify clones in the model from the linked library file.
Description
Clones are modeling patterns that have identical block types and connections. The Clone Detector (Simulink Check) identifies clones across the model. You can reuse components in your model by identifying clone patterns and replacing clones with links to the library blocks.
This check highlights the clones present in the model from the linked library.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Model contains a clone pattern from the linked library. | Replace the clones with links to the library file. |
Capabilities
You can run this check to:
- Highlight exact clones from the linked library. For more information, see Exact Clones and Similar Clones (Simulink Check).
- Highlight both subsystem clones and Simulink blocks with identical patterns from the linked library. For more information, see Specify Where to Detect Clones (Simulink Check).
Limitations
- The check cannot identify clones in variants, Stateflow charts, and MATLAB Function blocks in the model.
- The check does not highlight clones if a subsystem contains a nested subsystem that is more than two levels deep.
Action Results
Clicking the Fix button replaces the clones with links to the linked library file.
See Also
- Enable Component Reuse by Using Clone Detection (Simulink Check)
- Replace Exact Clones with Subsystem Reference (Simulink Check)
Refactor Bus Selector and Bus Creator blocks to In Bus Element and Out Bus Element blocks
Check ID:mathworks.m2m_edittime.BusPortsXform
Refactor Bus Selector and Bus Creator blocks to In Bus Element and Out Bus Element blocks.
Description
To simplify your model, it is recommended to use In Bus Element and Out Bus Element blocks instead of Bus Selector blocks for inputs and Bus Creator blocks for outputs. For more information, see Simplify Subsystem and Model Interfaces with Bus Element Ports.
This check highlights the Bus Selector and Bus Creator blocks in the model and you can transform those blocks toIn Bus Element and Out Bus Element blocks.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
Model contains Bus Selector and Bus Creator blocks. | Replace the Bus Selector and Bus Creator blocks to In Bus Element and Out Bus Element blocks. |
Capabilities
You can refactor the model by clicking Fix button in Model Advisor.
Action Results
Fix button transforms the model by replacing the suitableBus Selector and Bus Creator blocks to In Bus Element and Out Bus Element blocks.
See Also
- Check Model Compliance Using Edit-Time Checking (Simulink Check)
- Simplify Subsystem and Model Interfaces with Bus Element Ports
Clone Detection and Model Refactoring
Use Clone Detection and Model Refactoring checks to improve model componentization, readability, and enable reuse. If you have a Simulink Check license, you can use edit-time checking to identify clones from the linked library file and refactor Bus Selector and Bus Creator blocks to In Bus Element and Out Bus Element blocks during the model development process.
See Also
Check if the model settings to create an export-function model are satisfied
Check ID:mathworks.design.CheckExpFcnMdlSpecification
Check if both the modeling style and the execution domain settings conform to export-function model design requirements.
For more information, see Designate Model as Export-Function Model and Satisfy Export-Function Model Requirements.
Description
This check searches for any mismatch between the execution domain setting on the Property Inspector tab and the modeling style when you create an export-function model.
Results and Recommended Actions
Condition | Recommended Action |
---|---|
On the Property Inspector tab, execution domain is set as Export function, but the modeling style does not satisfy the export-function model design requirements. | Check fails. Consider changing the modeling style to satisfy the export-function model design requirements. For more information, see Designate Model as Export-Function Model and Satisfy Export-Function Model Requirements.However, if you need to keep the current modeling style, clear the Export function selection on theProperty Inspector. |
The modeling style indicates an export-function model, but the execution domain is not set as Export function. | Check fails. On the Property Inspector tab, go to the Execution tab. Select theSet execution domain parameter and, from the Domain list, selectExport function. |
See Also
Check for recursive event broadcasts in Stateflow
Check ID:mathworks.stateflow.RecursiveEventBroadcast.check
Identify recursion caused by undirected local events or local events that create early return logic.
Description
This check searches for and lists objects that use recursive event broadcasts caused by undirected local events or events that create early return logic. For more information on recursive event broadcasts, see Resolve Unintended Recursive Behavior (Stateflow).
Note
In a future release, Stateflow blocks will no longer support recursive event broadcasts caused by undirected local events or local events that create early return logic.
Results and Recommended Actions
See Also
- Resolve Unintended Recursive Behavior (Stateflow)