Main Content

Simulink Checks

Simulink Check Overview

Use the Simulink® Model Advisor checks to configure your model for simulation.

See Also

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 and Classic Initialization Mode.

Use the Model Advisor checks in Migrating to Simplified Initialization Mode to help migrate your model to simplified initialization mode.

See Also

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

ConditionRecommended 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 a Simulink 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

ConditionRecommended 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

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

ConditionRecommended Action
The specified optimizations are off.

Select the following optimization check boxes on the Optimization pane in the Configuration Parameters dialog box:

Select the following optimization check boxes on the Optimization pane in the Configuration Parameters dialog box:

Select the following optimization check boxes in the Configuration Parameters dialog box:

Select the following optimization check boxes on the Optimization pane in the Configuration Parameters dialog box:

Note

Model Advisor checks these parameters only if there is a Stateflow® chart in the model.

Application lifespan (days) is set as infinite. This could lead to expensive 64-bit counter usage. Choose a stop time if this is not intended.
The specified diagnostics, which can increase the time it takes to simulate your model, are set to warning or error.

Select none for:

  • Solver data inconsistency

  • Array bounds exceeded

  • Diagnostics > Data Validity > Simulation range checking

The specified Embedded Coder® parameters are off.

If you have an Embedded Coder license and you are using an ERT-based system target file:

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

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

  • Diagnostics > Data Validity > Inf or NaN block output

  • Diagnostics > Data Validity > Division by singular matrix

  • Diagnostics > Data Validity > Wrap on overflow

Also, for models referenced in accelerator mode, Simulink ignores the following Configuration Parameters > Diagnostics > Data Validity > Data Store Memory block parameters if you set them to a value other than Disable all. For details, see Data Store Diagnostics.

  • Detect read before write

  • Detect write after read

  • Detect write after write

Results and Recommended Actions

ConditionRecommended 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

ConditionRecommended Action
Model contains ignored parameter tunability information.Click the links to convert to equivalent Simulink parameter objects in the MATLAB® workspace.

See Also

Check for implicit signal resolution

Check ID: mathworks.design.ImplicitSignalResolution

Identify models that attempt to resolve named signals and states to Simulink.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

ConditionRecommended 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 subsystem boundary. Changing these to nonvirtual improves generated code efficiency.

Results and Recommended Actions

ConditionRecommended 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 a Simulink Check license.

See Also

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

ConditionRecommended 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 a Simulink Check license.

See Also

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.

Note

This check may overlap with Check model for block upgrade issues.

Results and Recommended Actions

ConditionRecommended 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 a Simulink 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 Library Link > Resolve link.

See Also

Restore Disabled Links

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 bus signals 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 click Update 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 signal crossing model reference boundary slow down the code generation process.

ConditionRecommended 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 and Outport block parameters and inserts Signal Conversion blocks, as necessary, to reduce the number of generated function arguments for the model.

See Also

Use Buses at Model Interfaces

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

ConditionRecommended 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 a Simulink Check license.

Tips

  • Right-click a block in your model to display the context menu. Choose Link Options and click Go 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

Restore Disabled Links

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

ConditionRecommended 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 a Simulink Check license.

See Also

Fix Unresolved Library Links

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

ConditionRecommended Action
Configurable subsystem blocks are identified.Convert these blocks to variant subsystem blocks to avoid compatibility issues. See Configurable Subsystem.

Capabilities and Limitations

You can run this check on your library models.

See Also

Convert to Variant Subsystem

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

ConditionRecommended 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

ConditionRecommended 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

ConditionRecommended Action
Configuration parameter Context-dependent inputs is set to Warning. This might lead to non-deterministic model execution.Set Configuration parameter Context-dependent inputs to Error.

See Also

Function-Call Subsystem

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

ConditionRecommended Action
The Duplicate data store names check is set to none or warning. Consider setting the Duplicate data store names check to error 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 for the Date Store Memory block

  • Global 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 the Signal Attributes pane of the Block Parameters dialog for the Date Store Memory block.

  • If you are using a global data store name, then specify its data type in the Simulink.Signal object.

The Multitask data store check is set to none or warning. Consider setting the Multitask data store check to error 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

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

ConditionRecommended Action
The Detect read before write check is disabled.Consider enabling Detect read before write in the Configuration Parameter dialog box Diagnostics> Data Validity pane.
The Detect write after read check is disabled.Consider enabling Detect write after read in the Configuration Parameter dialog box Diagnostics> Data Validity pane.
The Detect write after write check is disabled.Consider enabling Detect write after write in the Configuration Parameter dialog box Diagnostics> 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

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

ConditionRecommended 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 or Goto and From blocks.

Capabilities and Limitations

If you have a Simulink Check license, you can exclude blocks and charts from this check.

See Also

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 Update Diagram, identify potential issues relating to read-before-write, write-after-read, and write-after-write conditions for data store blocks.

Results and Recommended Actions

ConditionRecommended 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 the Diagnostics > Data Validity pane in the Configuration Parameters dialog box: Detect read before write, Detect write after read, and Detect write after write.

See Also

Check structure parameter usage with bus signals

Check ID: mathworks.design.MismatchedBusParams

Identify blocks and Simulink.Signal objects that initialize bus signals by using mismatched structures.

Description

In a model, you can use a MATLAB structure to initialize a bus signal. For example, if you pass a bus signal 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 bus signals. Matching these characteristics avoids unnecessary explicit typecasts and replaces field-by-field structure assignments with, for example, calls to memcpy.

Partial Structures

This check lists blocks and Simulink.Signal objects that initialize bus signals 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 Create Full Structures for Initialization and Create Partial Structures for Initialization.

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 signal 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 Signal (Simulink Coder).

Results and Recommended Actions

ConditionRecommended Action

Block or signal object uses partial structure

Consider using the function Simulink.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 a Simulink.Parameter object, and creating a Simulink.Bus object to use as the data type of the bus signal and of the parameter object. To control numeric data types, use the Simulink.BusElement objects in the bus object.

See Also

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, or Zero-Order Hold blocks to provide rate transition between input and output signals, Simulink makes a hidden replacement of these blocks with built-in Rate 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 and Zero-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, or Zero-Order Hold blocks act according to their algorithmic design to delay and hold signals respectively. Only Rate 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. Click Upgrade Model to replace these blocks with actual Rate Transition blocks.

Results and Recommended Actions

ConditionRecommended Action
Model has no instances of Delay, Unit Delay, or Zero-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.

  1. Click Upgrade Model to replace with actual Rate Transition blocks.

  2. Save changes to your model.

If you do not choose to replace the Delay, Unit Delay, and/or Zero-Order Hold blocks with actual Rate 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 a Simulink Check license.

See Also

Check for calls to slDataTypeAndScale

Check ID: mathworks.design.CallslDataTypeAndScale

Identify calls to the internal function slDataTypeAndScale.

Description

In some previous versions of Simulink, opening a model that had been saved in an earlier version triggers an automatic upgrade to code for data type handling. The automatic upgrade inserts calls to the internal function slDataTypeAndScale. Although Simulink continues to support some uses of the function, if you eliminate calls to it, you get cleaner and faster code.

Simulink does not support calls to slDataTypeAndScale when:

  • The first argument is a Simulink.AliasType object.

  • The first argument is a Simulink.NumericType object with property IsAlias set to true.

Running Check for calls to slDataTypeAndScale identifies calls to slDataTypeAndScale that are required or recommended for replacement. In most cases, running the check and following the recommended action removes the calls. You can ignore calls that remain. Run the check unless you are sure there are not calls to slDataTypeAndScale.

Results and Recommended Actions

ConditionRecommended Action
Required Replacement CasesManually or automatically replace calls to slDataTypeAndScale. Cases listed require you to replace calls to slDataTypeAndScale.
Recommended Replacement CasesFor the listed cases, it is recommended that you manually or automatically replace calls to slDataTypeAndScale.
Manual Inspection CasesInspect each listed case to determine whether it should be manually upgraded.

Capabilities and Limitations

If you have a Simulink Check license, you can exclude blocks and charts from this check.

Tips

  • Do not manually insert a call to slDataTypeAndScale into a model. The function was for internal use only.

  • Running Check for calls to slDataTypeAndScale calls the Simulink function slRemoveDataTypeAndScale. Calling this function directly provides a wider range of conversion options. However, you very rarely need more conversion options.

See Also

  • For more information about upgrading data types and scales, in the MATLAB Command Window, execute the following:

    • help slDataTypeAndScale

    • help slRemoveDataTypeAndScale

  • Model Advisor Exclusion Overview (Simulink Check)

Check bus signals treated as vectors

Check ID: mathworks.design.BusTreatedAsVector

Identify bus signals that Simulink treats as vectors.

Description

You cannot use bus signals that the Simulink software implicitly converts to vectors. Instead, either insert a Bus to Vector conversion block between the bus signal and the block input port that it feeds, or use the Simulink.BlockDiagram.addBusToVector command.

Results and Recommended Actions

ConditionRecommended Action

Bus signals are implicitly converted to vectors.

Use Simulink.BlockDiagram.addBusToVector or insert a Bus to Vector block.

Model is not configured to identify bus signals that Simulink treats as vectors.

In the Configuration Parameters dialog box, on the Diagnostics > Connectivity pane, set Bus signal treated as vector to error.

Action Results

Clicking Modify inserts a Bus to Vector block at the input ports of blocks that implicitly convert bus signals to vectors.

Tips

See Also

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

ConditionRecommended 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

ConditionRecommended 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

What Is Sample Time?.

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.

Note

Run this check along with the other checks in the Migrating to Simplified Initialization Mode Overview.

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

ConditionRecommended Action
Check the run-time diagnostic setting of the Merge block.
  1. In the Configuration Parameters dialog box, set Detect multiple driving blocks executing at the same time step to error.

  2. 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 unspecified Initial output value.

If you do not specify an explicit value for the Initial 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.

Note

Consider using Merge blocks only for signal elements that require true merging. You can combine other elements with merged elements using the Concatenate 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 of Merge block input signals takes place within a conditionally executed subsystem. Such designs may use Mux, Bus Creator, or Selector 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 executed Model block.
Check for Merge 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 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 the Merge block.

Note

Simulink generates a warning that the initial value of the signal object has been ignored.

See Also

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.

Note

Run this check along with the other checks in the Migrating to Simplified Initialization Mode Overview.

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

ConditionRecommended 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 separate Outport 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 the Constant block are examples of such blocks.

  • The Outport block shares the same signal source with another Outport 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 block

  • One of the input signals of the Outport block is specifying a Simulink.Signal object with an explicit initial value.

Check for Outport blocks that are driven by a bus signal and whose Initial output value is not scalar.For Outport blocks driven by bus signals, 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 signal, use IC structures. For more information, see Create Initial Condition Structures.

Check for Outport blocks that require an explicit signal copy.

An explicit copy of the bus signal driving the Outport 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 the Output parameter of the Signal Conversion block to Bus 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. The Ground block and the Constant block are examples of such blocks.

  • The Outport block shares the same signal source with another Outport 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 block

  • One of the input signals of the Outport block is specifying a Simulink.Signal object with an explicit initial value.

Check for merged Outport blocks that inherit the Initial 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 to reset.
Check for merged Outport blocks that are driven by nested conditionally executed subsystems.

Determine if the new behavior of the Outport 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 to held. 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 undefined Initial 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:

  1. In the Configuration Parameters dialog box, on the Solver pane, clear the option Automatically handle rate transition for data transfer.

  2. 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 the Outport 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:

  1. Set the Initial output parameter of the Outport block to [].

  2. Provide the initial value at the source of the data dependency signal rather than at the Outport 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.

Note

If 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 a Merge block, but its inputs are either unconnected or connected to Ground blocks. In the classic initialization mode, unconnected or grounded outports do not update the merge signal even when their parent conditionally executed subsystems are executing. In the simplified initialization mode, however, these outports 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 the Outport block is not specified. As a result, the simplified initialization mode will assume that the Initial output value for the Outport 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, the Initial output and Output when disabled parameters of the Outport 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 the Discrete-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 a Dialog 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 Check for library blocks with instances that cannot be migrated to learn about the different migration paths for other instances of each Outport block.

The Outport block will maintain its current settings and use its specified Initial output value.

Check for a migration conflict for Outport blocks that use Input signal 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 Check for library blocks with instances that cannot be migrated to learn about the different migration paths for other instances of each Outport block.

The Outport block currently specifies an Initial output of [] (empty matrix), and the Output when disabled as held. This means that each outport 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 to Input 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 Check for library blocks with instances that cannot be migrated to learn about the different migration paths for other instances of each Outport block.

The Outport blocks will continue to use an Initial output value of [] (empty matrix) and an Output when disabled setting of held. 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 Check for library blocks with instances that cannot be migrated to learn about the different migration paths for other instances of each Outport 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 the Outport 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 to held respectively, in simplified initialization mode.

See Also

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.

Note

Run this check along with the other checks in the Migrating to Simplified Initialization Mode Overview.

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

ConditionRecommended Action

Check for Discrete-Time Integrator blocks whose parameter Initial condition setting is set to Output.

Determine if the new behavior of the Discrete-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 whose Initial 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 set Initial Condition setting to Output.

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

Check model settings for migration to simplified initialization mode

Note

Do not run this check in isolation. Run this check along with the other checks in the Migrating to Simplified Initialization Mode Overview.

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 click Explore Result button, the messages pertain only to blocks that are not library-links.

Note

Because it is difficult to undo these changes, select File > Save Restore Point As 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

ConditionRecommended 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 Configuration Parameters > Underspecified initialization detection to Simplified.

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 the SourceOfInitialOutputValue parameter is set to Input signal.

  • If an Outport has an empty Initial output and a variable-size signal, then the Initial output is set to zero.

See Also

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

ConditionRecommended Action
Continuous states are modified in mdlOutputs method.Modify Continuous States at a major time step and use ssSetSolverNeedsReset function in S-function code.
Continuous states are modified in the mdlUpdate method.Modify Continuous States only at a major time step and use ssSetSolverNeedsReset function in S-function code.
S-function discrete states are modified in the mdlOutputs at a minor step.Modify the discrete states only at a major step guarded by ssIsMajorTimeStep function.
S-function mode vector is modified in the mdlOutputs method at a minor step.Modify the mode vector only at a major step guarded by sslsMajorTimeStep function.
S-function is using static or global variables to declare internal states.Declare the states explicitly using ssSetNumDiscStates 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 using ssSetSampleTime function.
S-function has discrete states but the mdlOutputs and mdlUpdate methods are combined.Define the mdlOutputs and mdlUpdate methods separately and modify discrete states only in mdlUpdate method.
S-function sets the SS_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

ConditionRecommended 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

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

ConditionRecommended Action
Solver data inconsistency is set to none.In the Configuration Parameters dialog box, set Solver data inconsistency to warning or error.
Array bounds exceeded is set to none.In the Configuration Parameters dialog box, set Array bounds exceeded to warning or error

Capabilities and Limitations

If you have a Simulink Check license, you can exclude blocks and charts from this check.

See Also

Identify unit mismatches in the model

Check ID: mathworks.design.UnitMismatches

Identify instances of unit mismatches between ports in the model.

Description

Check for instances of unit mismatches between ports in the model.

Results and Recommended Actions

ConditionRecommended Action
Unit mismatches foundChange 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

ConditionRecommended Action
Automatic unit conversions foundCheck 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

ConditionRecommended Action
Disallowed unit systems foundEither choose a unit that conforms to the configured unit system, or select another unit system. For more information, see Restricting 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

ConditionRecommended Action
Undefined units foundChange 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

ConditionRecommended Action
Ambiguous units foundYou can ignore the warning or specify the unit with corresponding unit system using the format unit_system::unit_name.

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

ConditionRecommended 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

ConditionRecommended Action
Model contains Lookup Table or Lookup Table (2-D) blocks and some of the blocks specify Use 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 with Sample time set to -1 that inherit a continuous sample time.

Replace Unit Delay blocks with Memory 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

ConditionRecommended 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

ConditionRecommended Action
Model, library, or subsystem not saved in the current version of Simulink.Consider resaving 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 Upgrade All Project Models, Libraries, and MATLAB Code Files.

See Also

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

ConditionRecommended Action
Model contains outdated SB2SL blocksConsider upgrading the model to current SB2SL blocks.

Action Results

Clicking Update SB2SL Blocks replaces blocks with the latest versions.

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

ConditionRecommended Action
Edited model history propertiesManually 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 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 About Source Control with Projects.

Results and Recommended Actions

ConditionRecommended 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

ConditionRecommended 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

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

ConditionRecommended 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

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

ConditionRecommended 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

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

ConditionRecommended Action
Libraries that need to be updated are foundClick 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 a Simulink Check license.

See Also

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 the imread() 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

ConditionRecommended Action
Mask display commands that make unnecessary calls to the imread() 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 a Simulink Check license.

See Also

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 of RunInitForIconRedraw is set to off, whereas, if there is mask workspace dependency the values is set to on.

Setting the values of RunInitForIconRedraw to off 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

ConditionRecommended 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 a Simulink Check license.

See Also

Identify masked blocks that specify tabs in mask dialog using MaskTabNames parameter

Check ID: mathworks.design.CheckAndUpdateOldMaskTabnames

This check identifies masked blocks that specify tabs in mask dialog using the MaskTabNames parameter.

Description

This check identifies masked blocks that use the MaskTabNames parameter to programmatically create tabs in the mask dialog. Since R2013b, dialog controls are used to group parameters in a tab on the mask dialog.

Results and Recommended Actions

ConditionRecommended Action
Masked blocks that use the MaskTabNames parameter to create tabs programmatically in the mask dialog are found.Click Upgrade available in the Action 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

ConditionRecommended 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 to single.

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 Configuration Parameters > Language standard 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

Check get_param calls for block CompiledSampleTime

Check ID: mathworks.design.CallsGetParamCompiledSampleTime

Use this check to identify MATLAB files in your working environment that contain get_param function calls to return the block CompiledSampleTime 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 if blkTs 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
    

    Since blkTs is now a cell array, Simulink gives this error message:

    Undefined function 'isinf' for input arguments of type 'cell'
    Instead, use this code, for which blkTs 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, since blkTs is now a cell array, Simulink gives this error:

    Undefined function 'eq' for input arguments of type 'cell'

    Instead, use this code, for which blkTs 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, since blkTs 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 async). In cases in which a block has constant sample time ([inf,0]) in addition to triggered or async or when a block has multiple async 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

ConditionRecommended Action
No MATLAB files call get_param(block,CompiledSampleTime)None
Some MATLAB files call get_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 single Simulink.SimulationOutput object.

Description

This check scans your model to verify if the parameter ReturnWorkspaceOutputs is enabled. Enabling this parameter, returns simulation outputs in a Simulink.SimulationOutput when simulating interactively. Simulation outputs include signal, state, output, DSM logging, and scope and To 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

ConditionRecommended Action
Simulation outputs are not returned as a single Simulink.SimulationOutput object

Return all simulation outputs as a single Simulink.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

ConditionRecommended Action

The model has rate transition issues.

Select Automatically handle rate transition for data transfer in the Solver 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, run

set_param(control_port,'DisallowConstTsAndPrmTs', 'on')

The model has an invalid control port value in a conditionally executed subsystem.

At the command prompt, run

set_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 bus signals that cross model reference boundaries.

Description

This check identifies root-level Inport and Outport blocks in referenced models and Model blocks with virtual bus outputs that require updates to change to nonvirtual bus signals.

If the check identifies issues, click Update Model to convert root-level Inport and Outport blocks configured for virtual buses to use nonvirtual buses in these situations:

  • For root-level Inport blocks — Enable the Output as nonvirtual bus parameter and insert a Signal Conversion block after the Inport block. The Signal Conversion block is configured to output a virtual bus.

  • For root-level Outport blocks — Enable the Output as nonvirtual bus in parent model parameter.

  • For Model blocks — For ports whose Outport blocks were updated to address issues, insert a Signal Conversion block after the corresponding ports of the Model block. The Signal Conversion block is configured to output a virtual bus.

Recommended Action and Results

To resolve issues, click Upgrade Model.

Note

Run the Analyze model hierarchy and continue upgrade sequence check on the top-level model and then down through the model reference hierarchy.

Clicking Upgrade Model converts affected root-level Inport and Outport blocks configured for virtual buses to use nonvirtual buses in models where you:

  • Use function prototype control

  • Perform C++ code generation with the I/O arguments step method option.

    Alternatively, you can change the C++ code generation function specification setting to Default step method:

    1. In the Configuration Parameters > Code Generation > Interface pane, click Configure C++ Class Interface.

    2. 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 for Outport 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 containing Outport blocks that have been fixed — Clicking Upgrade Model updates Model blocks referencing the models that had Outport blocks fixed by the Analyze model hierarchy and continue upgrade sequence check.

See Also

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

ConditionRecommended 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

ConditionRecommended Action

Custom-built S-functions are not supported.

Recompile your S-function with available compatible options. See Custom-built MEX File Not Supported In Current Release for more information.

S-function is not compiled with the latest API (mex -R2018a).

Recompile using the latest flag (mex -R2018a). See MEX File Is Compiled With Outdated Option for more information.

S-function uses 32-bit functions.

Modify your code according to the instructions in MEX File Calls A 32-bit Function.

S-function is using deprecated separate complex APIs (mxGetPi, mxSetPi, mxGetImagData, mxSetImagData).

Use interleaved complex APIs and recompile your code with the latest flag (mex -R2018a). See Upgrade MEX Files to Use Interleaved Complex API for more information.

S-function is using deprecated type-unsafe data API (mxGetData, mxSetData).Use type-safe data APIs and recompile your code. See MEX File Calls An Untyped Data Access Function for more information.
S-function is compiled with a future release and not supported in current release.See MEX File Built In MATLAB Release Not Supported In Current Release to recompile your files.

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

ConditionRecommended 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

ConditionRecommended 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 signal 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

ConditionRecommended Action

Virtual bus signal input to these blocks:

  • Assignment

  • Delay (if you specify an initial condition from the dialog box that is a MATLAB structure or zero and the value for State name is not empty)

  • Permute Dimension

  • Reshape

  • Selector

  • Unit Delay (if you specify an initial condition that is a MATLAB structure or zero and the value for State name is not empty)

  • Vector Concatenate

In the Upgrade Advisor, click Modify.

The check inserts a Bus to Vector block to attempt to convert virtual bus input signals to vector signals. 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 bus signals 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 PatternIssueSolution

Data Store Memory block with Data Type set to Inherit: auto

A Data Store Memory block whose associated Data Store Read or Data Store Write blocks read or write bus signal data must use a bus object.

In the Data Store Memory block, set the Data Type signal attribute to Bus: <BusObject>.

Signal Conversion block Output parameter matches input bus type

A Signal Conversion block whose Output parameter is set to Nonvirtual bus requires a virtual bus input.

A Signal Conversion block whose Output parameter is set to Virtual bus requires a nonvirtual bus input.

To create a copy of the input signal, set Output to Signal copy.

Merge, Switch, or Multiport Switch block with multiple bus inputs

Merge, Switch, or Multiport 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 to 1 or -1 (inherit).

Mux block with nonvirtual bus inputs

A Mux block cannot accept nonvirtual bus signals.

To treat the output as an array, replace the Mux 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 signal 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 the Assignment block Y0 port bus input to a vector.

Add a Bus to Vector block before the Assignment block.

S-function using a nonvirtual bus

An S-function that is not a Level-2 C S-function does not support nonvirtual bus signals.

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: <object name>.

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: <object name>.

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 with Constant value set to 0 and the Output data type signal attribute set to Bus: <object name>.

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

Check for root outports with constant sample time

Check ID: mathworks.design.CheckConstRootOutportWithInterfaceUpgrade

Use this check to identify root outports with a constant sample time used with an AUTOSAR target, Function Prototype Control, or the model C++ class interface.

Description

Root outports 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

ConditionRecommended Action

Root outport 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

ConditionRecommended Action
Child models foundClick 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 runIf there are no child models, click Continue 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:

  1. 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.

  2. 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

ConditionRecommended 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

ConditionRecommended 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

ConditionRecommended 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

ConditionRecommended 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 the Interpret 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

ConditionRecommended 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:

  1. Select the MATLAB Function block.

  2. Open the Property Inspector. In the Modeling tab, in the Design section, click Property Inspector.

  3. 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 enabledClick 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

ConditionRecommended 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 the Remove all temporary block highlighting link at the bottom of the Result 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

ConditionRecommended Action
Model contains one or more Environment Controller blocks.Replace Environment Controller blocks with Variant Source blocks with the Variant 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 use Simulink.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

ConditionRecommended Action
Variant block with inherit from Simulink.VariantControl activation time has no variant control variables of type Simulink.VariantControl.Change the type of at least one variant control variable to Simulink.VariantControl.

Capabilities and Limitations

  • You can run this check on your library models.

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).

Note

Starting in R2023a, Stateflow charts no longer support machine-parented data. Use the Upgrade Advisor to convert machine-parented data to chart-parented data store memory. For more information, see Consult the Upgrade Advisor and Check for machine-parented data.

Results and Recommended Actions

ConditionRecommended 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 of Parameter. 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 or Simulink.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 or Simulink.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.

  1. Open and upgrade each top model that uses the library.

    Upgrading the top model creates a Simulink.Parameter or Simulink.Signal object in the model workspace for each machine-parented data in the library.

  2. Save and close the top models.

  3. Open and upgrade the library model.

    Upgrading the library model creates chart-parented data that replaces the machine-parented data in the library.

  4. Save and close the library model.

See Also

Identify clones from the linked library

Check ID:mathworks.cloneDetection.libraryEdittime

Identify clones in the model from 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 linked library.

Results and Recommended Actions

ConditionRecommended Action
Model contains a clone pattern from the linked library.Replace the clones with links to the library file from Clone Detector app.

Capabilities

You can run this check to:

Limitations

  • The check cannot identify clones in variants and Stateflow chart in the model.

  • The check does not highlight clones if a subsystem contains nested subsystem which is more than two-level deep.

  • You cannot undo the change if you replace clones in the model.

Action Results

Fix button opens the Clone Detector app. Click Replace Clones and this replaces clones with links to the linked library file.

See Also

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 to In Bus Element and Out Bus Element blocks.

Results and Recommended Actions

ConditionRecommended 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 and Limitations

  • You can refactor the model by clicking Fix button in Model Advisor.

  • You cannot undo the changes once you transform the model.

Action Results

Fix button transforms the model by replacing the suitable Bus Selector and Bus Creator blocks to In Bus Element and Out Bus Element blocks.

See Also

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 the Property 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 the Set execution domain parameter and, from the Domain list, select Export function.

See Also