Main Content

万博1manbetxChecks

万博1manbetxCheck 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, seeSimplified Initialization ModeandClassic Initialization Mode.

Use the Model Advisor checks inMigrating to Simplified Initialization Modeto 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

Condition Recommended Action
Lines, input ports, or output ports are unconnected. Connect the signals. Double-click the list of unconnected items to locate failure.

Capabilities and Limitations

You can:

  • Run this check on your library models.

  • Exclude blocks and charts from this check if you have aSimulink Check™license.

Tips

Use thePortConnectivitycommand to obtain an array of structures describing block input or output ports.

See Also

Common Block Propertiesfor information on thePortConnectivitycommand.

Model Advisor Exclusion Overview(Simulink Check)

Check root model Inport block specifications

Check ID:mathworks.design.RootInportSpec

Check that root model Inport blocks fully define dimensions, sample time, and data type.

Description

Using root model Inport blocks that do not fully define dimensions, sample time, or data type can lead to undesired simulation results. Simulink software back-propagates dimensions, sample times and data types from downstream blocks unless you explicitly assign them values.

Results and Recommended Actions

Condition Recommended Action
Root-level Inport blocks have undefined attributes. Fully define the attributes of the root-level Inport blocks.

Capabilities and Limitations

If you have aSimulink Checklicense, you can exclude blocks and charts from this check.

Tips

The following configurations pass this check:

  • Configuration Parameters > Solver > Periodic sample time constraintis set toEnsure sample time independent

  • For export-function models,inherited sample timeis 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

Condition Recommended Action
The specified optimizations are off.

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

Select the following optimization check boxes on theOptimizationpane 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 theOptimizationpane 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. 如果这不是有意选择停止时间。
The specified diagnostics, which can increase the time it takes to simulate your model, are set towarningorerror.

Selectnonefor:

  • 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 containsModelblocks 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 thanNone.

  • 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 followingConfiguration Parameters>Diagnostics>Data Validity>Data Store Memory blockparameters if you set them to a value other thanDisable all. For details, seeData Store Diagnostics.

  • Detect read before write

  • 发现写后读

  • Detect write after write

Results and Recommended Actions

Condition Recommended Action

You want to see the results of running the identified diagnostics with settings to produce warnings or errors.

Simulate the model in Normal mode and resolve diagnostic warnings or errors.

Check for parameter tunability information ignored for referenced models

Check ID:mathworks.design.ParamTunabilityIgnored

Checks if parameter tunability information is included in the Model Parameter Configuration dialog box.

Description

Simulink software ignores tunability information specified in the Model Parameter Configuration dialog box. This check identifies those models containing parameter tunability information that Simulink software will ignore if the model is referenced by other models.

Results and Recommended Actions

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

See Also

Check for implicit signal resolution

Check ID:mathworks.design.ImplicitSignalResolution

Identify models that attempt to resolve named signals and states toSimulink.Signalobjects.

Description

Requiring Simulink software to resolve all named signals and states is inefficient and slows incremental code generation and model reference. This check identifies those signals and states for which you may turn off implicit signal resolution and enforce resolution.

Results and Recommended Actions

Condition Recommended Action
Not all signals and states are resolved. Turn off implicit signal resolution and enforce resolution for each signal and state that does resolve.

See Also

Resolve Signal Objects for Output Data.

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

Condition Recommended Action
Blocks that specify a virtual bus crossing a subsystem boundary. 改变the highlighted bus to nonvirtual.

Capabilities and Limitations

You can:

  • Run this check on your library models.

  • Exclude blocks and charts from this check if you have aSimulink Checklicense.

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

Condition Recommended Action
Discrete-Time Integrator blocks are not initialized during the model initialization phase. Add a Constant or Initial Condition block to feed the external Initial Condition port.

Capabilities and Limitations

You can:

  • Run this check on your library models.

  • Exclude blocks and charts from this check if you have aSimulink Checklicense.

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 withCheck model for block upgrade issues.

Results and Recommended Actions

Condition Recommended Action
Library links are disabled. Click theLibrary Link>Resolve linkoption in the context menu.

Capabilities and Limitations

You can:

  • Run this check on your library models.

  • Exclude blocks and charts from this check if you have aSimulink Checklicense.

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. SelectLibrary 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 clickUpdate Modelto 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.

Condition Recommended Action
Methods are listed that generate a large number of arguments for the current the model configuration that this check can reduce by modifying the model. ClickUpdate Model.

ClickingUpdate ModelresetsInportandOutportblock parameters and insertsSignal Conversionblocks, 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

Condition Recommended Action
Parameterized links are listed. Verify that the links are intended to be parameterized.

Capabilities and Limitations

You can:

  • Run this check on your library models.

  • Exclude blocks and charts from this check if you have aSimulink Checklicense.

Tips

  • Right-click a block in your model to display the context menu. ChooseLink Optionsand clickGo To Library Blockto see the original block from the library.

  • To parameterize a library link, chooseLook 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

Condition Recommended Action
Library links are unresolved. Locate missing library block or an alternative.

Capabilities and Limitations

You can:

  • Run this check on your library models.

  • Exclude blocks and charts from this check if you have aSimulink Checklicense.

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

Condition Recommended Action
Configurable subsystem blocks are identified. Convert these blocks to variant subsystem blocks to avoid compatibility issues. SeeConfigurable 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 identifyVariant Modelblocks.

Results and Recommended Actions

Condition Recommended Action

Variant Modelblocks available in the model are listed.

Convert these blocks toVariant Subsystemblocks.

See Also

Convert to Variants

Identify Variant blocks using Variant objects with empty conditions

Check ID:mathworks.design.emptyVariantObjects

Search the model to identify the Variant blocks or library having empty Variant objects.

Results and Recommended Actions

Condition Recommended Action
The Variant blocks in the model or library having empty Variant objects are listed. Use valid conditions in the variant objects.

See Also

Introduction to Variant Controls

Check usage of function-call connections

Check ID:mathworks.design.CheckForProperFcnCallUsage

Check model diagnostic settings that apply to function-call connectivity and that might impact model execution.

Description

Check for connectivity diagnostic settings that might lead to non-deterministic model execution.

Results and Recommended Actions

Condition Recommended Action
Diagnostic > Connectivity > Context-dependent inputsis set toDisable AllorUse local settings. This might lead to non-deterministic model execution. SetDiagnostics > Connectivity > Context-dependent inputstoEnable all as errors.

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 toData Store Memoryblocks.

Description

Checks for multitasking data integrity, strong typing, and shadowing of data stores of higher scope.

Results and Recommended Actions

Condition Recommended Action
TheDuplicate data store namescheck is set tononeorwarning. Consider setting theDuplicate data store namescheck toerrorin the Configuration Parameters dialog box, on theDiagnostics > Data Validitypane.

The data store variable names are not strongly typed in one of the following:

  • Signal Attributespane of theBlock Parametersdialog for theDate Store Memoryblock

  • Global data store name

指定a data type other than auto by taking one of the following actions:

  • Choose a data type other thanInherit: autoon theSignal Attributespane of theBlock Parametersdialog for theDate Store Memoryblock.

  • If you are using a global data store name, then specify its data type in theSimulink.Signalobject.

TheMultitask data storecheck is set tononeorwarning. Consider setting theMultitask data storecheck toerrorin the Configuration Parameters dialog box, on theDiagnostics > Data Validitypane.

Capabilities and Limitations

If you have aSimulink Checklicense, 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

Condition Recommended Action
TheDetect read before writecheck is disabled. Consider enablingDetect read before writein the Configuration Parameter dialog boxDiagnostics> Data Validitypane.
The发现写后读check is disabled. Consider enabling发现写后读in the Configuration Parameter dialog boxDiagnostics> Data Validitypane.
TheDetect write after writecheck is disabled. Consider enablingDetect write after writein the Configuration Parameter dialog boxDiagnostics> Data Validitypane.

Capabilities and Limitations

Exclude blocks and charts from this check if you have aSimulink Checklicense.

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 toDisable 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

Condition Recommended Action
Data store blocks in your model have continuous or fixed-in-minor-step sample times. Consider making the listed blocks discrete or replacing them with eitherMemoryorGotoandFromblocks.

Capabilities and Limitations

If you have aSimulink Checklicense, 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 anUpdate 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

Condition Recommended Action
Reading and writing (read-before-write or write-after-read condition) occur out of order. Consider restructuring your model so that the Data Store Read block executes before the Data Store Write block.
Multiple writes occur within a single time step. 改变the model to write data only once per time step or refer to the following Tips section.

Capabilities and Limitations

If you have aSimulink Checklicense, you can exclude blocks and charts from this check.

Tips

This check performs a static analysis which might not identify every instance of improper usage. Specifically, Function-Call Subsystems, Stateflow Charts, MATLAB for code generation, For Iterator Subsystems, and For Each Subsystems can cause both missed detections and false positives. For a more comprehensive check, consider enabling the following diagnostics on theDiagnostics > Data Validitypane in the Configuration Parameters dialog box:Detect read before write,发现写后读, andDetect write after write.

See Also

Check structure parameter usage with bus signals

Check ID:mathworks.design.MismatchedBusParams

Identify blocks andSimulink.Signalobjects 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 aUnit Delayblock, you can set theInitial conditionparameter to a structure. For basic information about initializing buses by using structures, see指定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 tomemcpy.

Partial Structures

This check lists blocks andSimulink.Signalobjects 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, seeCreate Full Structures for InitializationandCreate Partial Structures for Initialization.

Data Type Mismatches

This check lists blocks andSimulink.Signalobjects 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 theUnit Delayblock, 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. SeeGenerate Tunable Initial Condition Structure for Bus Signal(Simulink Coder).

Results and Recommended Actions

Condition Recommended Action

Block or signal object uses partial structure

Consider using the functionSimulink.Bus.createMATLABStructureto create a full initial condition structure.

Data types of structure fields do not match data types of corresponding signal elements

Consider defining the structure as aSimulink.Parameterobject, and creating aSimulink.Busobject to use as the data type of the bus signal and of the parameter object. To control numeric data types, use theSimulink.BusElementobjects in the bus object.

See Also

Check Delay, Unit Delay and Zero-Order Hold blocks for rate transition

Check ID:mathworks.design.ReplaceZOHDelayByRTB

IdentifyDelay,Unit Delay, orZero-Order Holdblocks that are used for rate transition. Replace these blocks with actualRate Transitionblocks.

Description

If a model usesDelay,Unit Delay, orZero-Order Holdblocks to provide rate transition between input and output signals, Simulink makes a hidden replacement of these blocks with built-inRate Transitionblocks. 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 forDelayandUnit Delay blocks, and fast-to-slow forZero-Order Holdblock). Set the block sample time to be equal to the slower rate (source for theDelayandUnit Delayblocks and destination for theZero-Order Holdblock).

  • When the block sample time of a downstream or upstream block changes, theseDelay,Unit DelayandZero-Order Holdblocks 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 replaceDelay,Unit Delay, orZero-Order Holdblocks with actualRate Transitionblocks.

  • The technique ensures unambiguous results in block behavior.Delay,Unit Delay, orZero-Order Holdblocks act according to their algorithmic design to delay and hold signals respectively. OnlyRate Transitionblocks perform actual rate transition.

  • Using an actualRate Transitionblock 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 whereDelay,Unit DelayorZero-Order Holdblocks undergo hidden replacement to provide rate transition between signals. ClickUpgrade Modelto replace these blocks with actualRate Transitionblocks.

Results and Recommended Actions

Condition Recommended Action
Model has no instances ofDelay,Unit Delay, orZero-Order Holdblocks used for rate transition. No action required.
Model has instances ofDelay,Unit Delay, orZero-Order Holdblocks used for rate transition.

The check identifies these instances and allows you to upgrade the model.

  1. ClickUpgrade Modelto replace with actualRate Transitionblocks.

  2. Save changes to your model.

If you do not choose to replace theDelay,Unit Delay, and/orZero-Order Holdblocks with actualRate Transitionblocks, Simulink continues to perform a hidden replacement of these blocks with built-in rate transition blocks.

Capabilities and Limitations

You can:

  • Run this check on your library models.

  • Exclude blocks and charts from this check if you have aSimulink Checklicense.

See Also

Check for calls to slDataTypeAndScale

Check ID:mathworks.design.CallslDataTypeAndScale

Identify calls to the internal functionslDataTypeAndScale.

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 functionslDataTypeAndScale. 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 toslDataTypeAndScalewhen:

  • The first argument is aSimulink.AliasTypeobject.

  • The first argument is aSimulink.NumericTypeobject with propertyIsAliasset to true.

RunningCheck for calls to slDataTypeAndScaleidentifies calls toslDataTypeAndScalethat 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 toslDataTypeAndScale.

Results and Recommended Actions

Condition Recommended Action
Required Replacement Cases Manually or automatically replace calls toslDataTypeAndScale. Cases listed require you to replace calls toslDataTypeAndScale.
Recommended Replacement Cases For the listed cases, it is recommended that you manually or automatically replace calls toslDataTypeAndScale.
Manual Inspection Cases Inspect each listed case to determine whether it should be manually upgraded.

Capabilities and Limitations

If you have aSimulink Checklicense, you can exclude blocks and charts from this check.

Tips

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

  • RunningCheck for calls to slDataTypeAndScalecalls the Simulink functionslRemoveDataTypeAndScale. 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 aBus to Vectorconversion block between the bus signal and the block input port that it feeds, or use theSimulink.BlockDiagram.addBusToVectorcommand.

Results and Recommended Actions

Condition Recommended Action

Bus signals are implicitly converted to vectors.

UseSimulink.BlockDiagram.addBusToVectoror 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 theDiagnostics> Connectivitypane, setBus signal treated as vectortoerror.

Action Results

ClickingModifyinserts 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

Condition Recommended Action
The listed block input ports could have an implicit Signal Conversion block.

Decide if a one-step delay in returning signal values is acceptable for the listed signals.

  • If the delay is not acceptable, rework your model so that the input signal originates from within the calling subsystem.

  • If the delay is acceptable, insert a Unit Delay block in front of each listed input port.

Capabilities and Limitations

If you have aSimulink Checklicense, you can exclude blocks and charts from this check.

See Also

Signal Conversionblock

Unit Delayblock

Model Advisor Exclusion Overview(Simulink Check)

Identify block output signals with continuous sample time and non-floating point data type

Check ID:mathworks.design.OutputSignalSampleTime

Find continuous sample time, non-floating-point output signals.

Description

Non-floating-point signals might not represent continuous variables without loss of information.

Results and Recommended Actions

Condition Recommended Action
Signals with continuous sample times have a non-floating-point data type. On the identified signals, either change the sample time to be discrete or fixed-in-minor-step ([0 1]).

Capabilities and Limitations

If you have aSimulink Checklicense, 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 theMigrating to Simplified Initialization Mode Overview.

Description

Simplified initialization mode was introduced in R2008b to improve the consistency of simulation results. For more information, seeSimplified Initialization ModeandClassic Initialization Mode.

This Model Advisor check identifies settings in theMerge块在你的模型,如果你可能会导致一些问题u use classic initialization mode. It also recommends settings for consistent behavior of Merge blocks. The results of the subchecks contain two types of statements: Failed and Warning. Failed statements identify issues that you must address manually before you can migrate the model to the simplified initialization mode. Warning statements identify issues or changes in behavior that can occur after migration.

Results and Recommended Actions

Condition Recommended Action
Check the run-time diagnostic setting of the Merge block.
  1. In the Configuration Parameters dialog box, setDetect multiple driving blocks executing at the same time steptoerror.

  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 theMuxblock used to produce the input signal and theMergeblock with one multi-inputMergeblock.

Single-inputMergeblocks are not supported in the simplified initialization mode.

Check for root Merge blocks that have an unspecifiedInitial outputvalue.

If you do not specify an explicit value for theInitial outputparameter ofroot Merge blocks, then Simulink uses the default initial value of the output data type.

A rootMergeblock is aMergeblock with an output port that does not connect to anotherMergeblock. For information on the default initial value, seeInitialize Signal Values.

Check for Merge blocks with nonzero input port offsets.

Clear theAllow unequal port widthsparameter of theMergeblock.

Note

Consider usingMergeblocks only for signal elements that require true merging. You can combine other elements with merged elements using theConcatenateblock.

Check for Merge blocks that have unconnected inputs or that have inputs from non-conditionally executed subsystems.

Set theNumber of inputsparameter of theMergeblock to the number of Merge block inputs. You must connect each input to a signal.

Verify that eachMergeblock input is driven by a conditionally executed subsystem.Mergeblocks cannot be driven directly by anIterator Subsystemor 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 ofMergeblock input signals takes place within a conditionally executed subsystem. Such designs may useMux,Bus Creator, orSelectorblocks.

Check for Merge blocks with inconsistent input sample times.

Verify that input signals to eachMergeblock have the sameSample time.

Failure to do so could result in unpredictable behavior. Consequently, the simplified initialization mode does not allow inconsistent sample times.

Check for Merge blocks with multiple input ports that are driven by a single source. Verify that theMergeblock does not have multiple input signals that are driven by the same conditionally executed subsystem or conditionally executedModelblock.
Check for Merge blocks that use signal objects to specify theInitial outputvalue.

Verify that the following behavior is acceptable.

In the simplified initialization mode, signal objects cannot specify theInitial outputparameter of theMergeblock. While you can still initialize the output signal for aMergeblock using a signal object, the initialization result may be overwritten by that of theMergeblock.

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 theMigrating 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, seeSimplified Initialization ModeandClassic Initialization Mode.

这个模型顾问检查标识外港块and conditional subsystems in your model that can cause problems if you use the simplified initialization mode. It also recommends settings for consistent behavior of Outport blocks. The results of the subchecks contain two types of statements: Failed and Warning. Failed statements identify issues that you must address manually before you can migrate the model to the simplified initialization mode. Warning statements identify issues or changes in behavior can occur after migration.

Results and Recommended Actions

Condition Recommended Action
Check for blocks inside of the Iterator Subsystem that require elapsed time.

Within an Iterator Subsystem hierarchy, do not use blocks that require a service that maintains the time that has elapsed between two consecutive executions.

Since an Iterator Subsystem can execute multiple times at a given time step, the concept of elapsed time is not well-defined between two such executions. Using these blocks inside of an Iterator Subsystem can cause unexpected behavior.

Check for Outport blocks that have conflicting signal buffer requirements.

TheOutport块有一个函数调用触发或函数调用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 separateOutportblock. For examples of function-call data dependency violations, see the example modelsl_subsys_semantics.

A standard data signal may require an additional signal copy for one of the following reasons:

  • TheOutportblock is driven by a block with output that cannot be overwritten. TheGroundblock and theConstantblock are examples of such blocks.

  • TheOutportblock shares the same signal source with anotherOutportblock in the same subsystem or in one nested within the current subsystem but having a different initial output value.

  • TheOutportblock connects to the input of aMergeblock

  • One of the input signals of theOutportblock is specifying aSimulink.Signalobject with an explicit initial value.

Check for Outport blocks that are driven by a bus signal and whoseInitial outputvalue is not scalar. ForOutportblocks 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 theInitial Outputparameter. After migration completes, to specify different initial values for different elements of the bus signal, use IC structures. For more information, seeCreate Initial Condition Structures.

Check for Outport blocks that require an explicit signal copy.

An explicit copy of the bus signal driving theOutportblock is required for the initialization of the output signal of the corresponding subsystem. Insert aSignal Conversionblock before theOutportblock, then set theOutputparameter of theSignal Conversionblock toBus copy.

A standard data signal may require an additional signal copy for one or more of the following reasons:

  • A block with output that cannot be overwritten is driving theOutportblock. TheGroundblock and theConstantblock are examples of such blocks.

  • TheOutportblock shares the same signal source with anotherOutportblock in the same subsystem or in one nested within the current subsystem but having a different initial output value.

  • TheOutportblock connects to the input of aMergeblock

  • One of the input signals of theOutportblock is specifying aSimulink.Signalobject with an explicit initial value.

Check for merged Outport blocks that inherit theInitial Outputvalue from Outport blocks that have been configured to reset when the blocks become disabled. WhenOutportblocks are driving a Merge block, do not set theirOutput when disabledparameters toreset.
Check for mergedOutportblocks that are driven by nested conditionally executed subsystems.

Determine if the new behavior of theOutportblocks 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 theOutput when disabledparameter of theOutportblock toheld. This setting is required because theOutportblock connects to aMergeblock.

For more information, seeOutport.

Check for Outport blocks that have an undefinedInitial outputvalue with invalid initial condition sources.

Verify that the following behavior is acceptable.

When theInitial outputparameter is unspecified ([]), it inherits the initial output from the source blocks. If at least one of the sources of theOutportblock 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 anOutportblocks can inherit theInitial outputvalue 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 aRate Transition块的输入Outportblock. Specify theInitial outputparameter for eachOutportblock.

Otherwise, perform the following procedure:

  1. In the Configuration Parameters dialog box, on theSolverpane, clear the optionAutomatically 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 undefinedInitial outputvalue.

Verify that the following behavior is acceptable.

指定theInitial outputparameter for theOutportblock. Set this value to[](empty matrix) to use the default initial value of the output data type.

Check theInitial outputsetting of Outport blocks that reset when they are disabled.

指定theInitial outputparameter of theOutportblock.

You must specify theInitial outputvalue for blocks that are configured to reset when they become disabled.

Check theInitial outputsetting for Outport blocks that pass through a function-call data dependency signal.

You cannot specify anInitial outputvalue for theOutportblock because function-call data dependency signals are passing through it. To set theInitial outputvalue:

  1. Set theInitial outputparameter of theOutportblock to[].

  2. Provide the initial value at the source of the data dependency signal rather than at theOutportblock.

Check for Outport blocks that use signal objects to specify theInitial outputvalue.

Verify that the following behavior is acceptable.

In the simplified initialization mode, signal objects cannot specify theInitial outputparameter of anOutportblock. You can still initialize the input or output signals for anOutportblock using signal objects, but the initialization results may be overwritten by those of theOutportblock.

Note

If you are working with a conditionally executed subsystemOutportblock, 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.

TheOutportblock is driving aMergeblock, but its inputs are either unconnected or connected toGroundblocks. 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 theInitial outputvalue from an input signal when they are migrated.

Verify that the following behavior is acceptable.

TheInitial outputparameter of theOutportblock is not specified. As a result, the simplified initialization mode will assume that theInitial outputvalue for theOutport块是来自输入信号。这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 outerOutportblocks that have an explicitInitial output.

Verify that the following behavior is acceptable.

In classic initialization mode, theInitial outputandOutput when disabledparameters of theOutportblock must match those of their sourceOutportblocks.

In simplified initialization mode, Simulink sets theInitial outputparameter of outer Outport blocks to[](empty matrix) andOutput when disabledparameter toheld.

Check for blocks that read input from conditionally executed subsystems during initialization.

Verify that the following behavior is acceptable.

Some blocks, such as theDiscrete-Time Integrator块,从有条件地execut读取他们的输入ed 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 correspondingOutportblock. 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 aDialogas theSource of initial output value.

Other instances of Outport blocks with the same library link either cannot be migrated or are being migrated in a different manner. Review the results from theCheck for library blocks with instances that cannot be migratedto learn about the different migration paths for other instances of eachOutportblock.

TheOutportblock will maintain its current settings and use its specifiedInitial outputvalue.

Check for a migration conflict for Outport blocks that useInput signalas theSource of initial outputvalue.

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 theCheck for library blocks with instances that cannot be migratedto learn about the different migration paths for other instances of eachOutportblock.

TheOutportblock currently specifies anInitial outputof[](empty matrix), andthe Output when disabledasheld. This means that each outport does not perform initialization, but implicitly relies on source blocks to initialize its input signal.

After migration, the parameterSource of initial output valuewill be set toInput signalto 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 theCheck for library blocks with instances that cannot be migratedto learn about the different migration paths for other instances of eachOutportblock.

TheOutportblocks will continue to use anInitial outputvalue of[](empty matrix) and anOutput when disabledsetting ofheld. Simulink will maintain these settings because their parent conditionally executed subsystems are connected to SimEvents blocks.

Check for a migration conflict for innermost Outport blocks with variable-size input and unspecifiedInitial 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 theInitial outputparameter 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 theCheck for library blocks with instances that cannot be migratedto learn about the different migration paths for other instances of eachOutportblock.

Check for a migration conflict for Outport blocks that use a default ground value as the Initial output. The parameterInitial outputis set to[](empty matrix) and the source of theOutportis 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 ofInitial output. Review the results from the subcheckCheck for library blocks with instances that cannot be migratedto learn about different migration paths for other instances of each Outport block. For the remaining Outport blocks,Initial outputis set to[](empty matrix) andOutput when disabledis set toheldrespectively, 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 theMigrating to Simplified Initialization Mode Overview.

Description

Simplified initialization mode was introduced in R2008b to improve the consistency of simulation results. For more information, seeSimplified Initialization ModeandClassic Initialization Mode.

This Model Advisor check identifies settings in Discrete-Time Integrator blocks in your model that can cause problems if you use the simplified initialization mode. It also recommends settings for consistent behavior of Discrete-Time Integrator blocks. The results of the subchecks contain two types of statements: Failed and Warning. Failed statements identify issues that you must address manually before you can migrate the model to the simplified initialization mode. Warning statements identify issues or changes in behavior that can occur after migration.

Results and Recommended Actions

Condition Recommended Action

Check for Discrete-Time Integrator blocks whose parameterInitial condition settingis set toOutput.

Determine if the new behavior of theDiscrete-Time Integratorblocks is acceptable. If it is not acceptable, modify the model to account for the new behavior before migrating to the simplified initialization mode.

Check for Discrete-Time Integrator blocks whoseInitial condition settingparameter is set toState (most efficient)and are in a subsystem that uses triggered sample time.

Use periodic sample time for the block, or setInitial Condition settingtoOutput.

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 theMigrating 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, seeSimplified Initialization ModeandClassic Initialization Mode.

This Model Advisor check identifies issues in the model configuration parameters andModelblocks in your model that can cause problems when you migrate to simplified initialization mode. The results of the subchecks contain two types of statements: Failed and Warning. Failed statements identify issues that you must address manually before you can migrate the model to simplified initialization mode. Warning statements identify issues or changes in behavior that can occur after migration.

After running this Model Advisor consistency check, if you clickExplore Resultbutton, the messages pertain only to blocks that are not library-links.

Note

Because it is difficult to undo these changes, selectFile>Save Restore Point Asto back up your model before migrating to the simplified initialization mode.

For more information, seeModel Configuration Parameters: Connectivity Diagnostics.

Results and Recommended Actions

Condition Recommended Action

Verify that all Model blocks are using the simplified initialization mode.

Migrate the model referenced by the Model block to the simplified initialization mode, then migrate the top model.

Verify simplified initialization mode setting

SetConfiguration Parameters>Underspecified initialization detectiontoSimplified.

Action Results

ClickingModify Settingscauses the following:

  • The Model parameter is set tosimplified

  • If an Outport block has theInitial outputparameter set to the empty character vector,[], then theSourceOfInitialOutputValueparameter is set toInput signal.

  • If an Outport has an emptyInitial outputand a variable-size signal, then theInitial outputis 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.

Results and Recommended Actions

Condition Recommended Action
Continuous states are modified inmdlOutputsmethod. Modify Continuous States at a major time step and usessSetSolverNeedsResetfunction in S-function code.
Continuous states are modified in themdlUpdatemethod. Modify Continuous States only at a major time step and usessSetSolverNeedsResetfunction in S-function code.
S-function discrete states are modified in themdlOutputsat a minor step. Modify the discrete states only at a major step guarded byssIsMajorTimeStep函数。
S-function mode vector is modified in themdlOutputsmethod at a minor step. Modify the mode vector only at a major step guarded bysslsMajorTimeStep函数。
S-function is using static or global variables to declare internal states. Declare the states explicitly usingssSetNumDiscStatesfunction orModel Global Data by Creating Data Stores.
S-function has continuous states but sample time is not declared continuous. 指定continuous sample time usingssSetSampleTime函数。
S-function has discrete states but themdlOutputsandmdlUpdatemethods are combined. Define themdlOutputsandmdlUpdatemethods separately and modify discrete states only inmdlUpdatemethod.
S-function sets theSS_OPTION_CAN_BE_CALLED_CONDITIONALLYoption when having state-like data or multiple sample times. Remove the options when the S-function has state-like data or multiple sample times.
MEXcompilers do not exist on the machine. Check for the presence or installMEXcompilers on the machine.
S-function encounters errors while compiling the model. Check theDiagnostic Vieweroutput and recompile the model.

Check for non-continuous signals driving derivative ports

Check ID:mathworks.design.NonContSigDerivPort

Identify noncontinuous signals that drive derivative ports.

Description

Noncontinuous signals that drive derivative ports cause the solver to reset every time the signal changes value, which slows down simulation.

Results and Recommended Actions

Condition Recommended Action
There are noncontinuous signals in the model driving derivative ports.
  • Make the specified signals continuous.

  • Replace the continuous blocks receiving these signals with discrete state versions of the blocks.

Capabilities and Limitations

If you have aSimulink Checklicense, 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 ifS-Functionblocks are in the model.

Description

Validates whetherS-Functionblocks adhere to the ODE solver consistency rules that Simulink applies to its built-in blocks.

Results and Recommended Actions

Condition Recommended Action
Solver data inconsistencyis set tonone. In the Configuration Parameters dialog box, setSolver data inconsistencytowarningorerror.
Array bounds exceededis set tonone. In the Configuration Parameters dialog box, setArray bounds exceededtowarningorerror

Capabilities and Limitations

If you have aSimulink Checklicense, you can exclude blocks and charts from this check.

See Also

Check model for foreign characters

Check ID:mathworks.design.characterEncoding

Check for characters that are incompatible with the current encoding

Description

Check for characters in the model file that cannot be represented in the current encoding. These can cause errors when you try to save the model.

Results and Recommended Actions

Condition Recommended Action
Incompatible characters found 改变the current encoding toUTF-8by usingslCharacterEncoding.

Tips

The Upgrade Advisor report shows the required encoding you need, or you can retrieve the encoding from the model by using the command:

get_param(modelname,'SavedCharacterEncoding')

To change the encoding, useslCharacterEncoding. This setting applies to the current MATLAB session. If you restart MATLAB and want to save the same model again, you must make the same change to the current encoding.

For more information see:

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

Condition Recommended Action
Unit mismatches found 改变one of the mismatched unit settings to match the unit settings for the other port.

See Also

Identify automatic unit conversions in the model

Check ID:mathworks.design.AutoUnitConversions

Identify instances of automatic unit conversions in the model.

Description

Identify instances of automatic unit conversions in the model.

Results and Recommended Actions

Condition Recommended Action
Automatic unit conversions found Check that the converted units are expected for the model.

See Also

Identify disallowed unit systems in the model

Check ID:mathworks.design.DisallowedUnitSystems

确定不允许单位系统t的实例he model.

Description

确定不允许单位系统t的实例he model.

Results and Recommended Actions

Condition Recommended Action
Disallowed unit systems found Either choose a unit that conforms to the configured unit system, or select another unit system. For more information, seeRestricting Unit Systems.

See Also

Identify undefined units in the model

Check ID:mathworks.design.UndefinedUnits

Identify instances of unit specifications, not defined in the unit database, in the model.

Description

Identify instances of unit specifications, not defined in the unit database, in the model.

Results and Recommended Actions

Condition Recommended Action
Undefined units found 改变the unit to one that Simulink supports.

See Also

Identify ambiguous units in the model

Check ID:mathworks.design.AmbiguousUnits

Identify instances of ambiguous unit specifications, such as duplicate unit names in the unit database, in the model.

Description

Identify instances of ambiguous unit specifications, such as duplicate unit names in the unit database, in the model.

Results and Recommended Actions

Condition Recommended Action
Ambiguous units found You can ignore the warning or specify the unit with corresponding unit system using the formatunit_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

Condition Recommended Action
Blocks with compatibility issues found. ClickModifyto 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

ClickingModifyreplaces blocks from a previous release of Simulink software with the latest versions.

See Also

Check model for block upgrade issues requiring compile time information

Check ID:mathworks.design.UpdateRequireCompile

Check for common block upgrade issues.

Description

Check blocks for compatibility issues resulting from upgrading to a new version of Simulink software. Some block upgrades require the collection of information or data when the model is in the compile mode. For this check, the model is set to compiled mode and then checked for upgrades.

Results and Recommended Actions

Condition Recommended Action
Model containsLookup TableorLookup Table (2-D)blocks and some of the blocks specifyUse Input NearestorUse Input Abovefor a lookup method. ReplaceLookup Tableblocks andLookup Table (2-D)blocks withn-D Lookup Tableblocks. Do not applyUse Input NearestorUse Input Above查找方法;选择另一个选择。
Model containsLookup TableorLookup Table (2-D)blocks and some blocks perform multiplication first during interpolation. ReplaceLookup Tableblocks andLookup Table (2-D)blocks withn-D Lookup Tableblocks. However, because then-D Lookup Tableblock performs division first, this replacement might cause a numerical difference in the result.
Model containsLookup TableorLookup Table (2-D)blocks. Some of these blocks specifyInterpolation-Extrapolationas theLookup methodbut their input and output are not the same floating-point type. ReplaceLookup Tableblocks andLookup Table (2-D)blocks withn-D Lookup Tableblocks. Then change the extrapolation method or the port data types for block replacement.

Model containsUnit Delayblocks withSample timeset to-1that inherit a continuous sample time.

ReplaceUnit Delayblocks withMemoryblocks.

Check Data Store Memory blocks for multitasking

Action Results

ClickingModifyreplaces blocks from a previous release of Simulink software with the latest versions.

See Also

Check that the model is saved in SLX format

Check ID:mathworks.design.UseSLXFile

Check that the model is saved in SLX format.

Description

Check whether the model is saved in SLX format.

Results and Recommended Actions

Condition Recommended Action
Model not saved in SLX format Consider upgrading to the SLX file format to use the latest features in Simulink.

Capabilities and Limitations

You can run this check on your library models.

Tips

Projects can help you upgrade models to SLX format and preserve file revision history in source control. SeeConvert from MDL to SLX in a Project and Preserve Revision History.

See Also

Check if SLX file compression is off

Check ID:mathworks.design.CheckSLXFileCompressionLevel

Check if SLX file compression is turned off to reduce Git™ repository size.

Description

Check whether compression for the SLX model is turned off.

Results and Recommended Actions

Condition Recommended Action
Model, library, or subsystem is saved in SLX format. File compression is turned on. Consider turning off file compression to optimize storage under source control.
Model, library, or subsystem is not saved in SLX format. Consider upgrading to the SLX file format then, 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.

Tips

Projects can help you upgrade all the models and libraries in your project. SeeUpgrade All Project Models, Libraries, and MATLAB Code Files.

See Also

Check that the model or library is saved in current version

Check ID:mathworks.design.CheckSavedInCurrentVersion

Check that the model, library, or subsystem is saved in the current version of Simulink.

Description

Check whether the model file is saved in the current Simulink release.

Results and Recommended Actions

Condition Recommended Action
Model, library, or subsystem not saved in the current version of Simulink. Consider 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. SeeUpgrade 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

Condition Recommended Action
Model contains outdated SB2SL blocks Consider upgrading the model to current SB2SL blocks.

Action Results

ClickingUpdate SB2SL Blocksreplaces 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

Condition Recommended Action
Edited model history properties Manually or automatically reset the properties to the default values. Click the button to reset, or to inspect and change these properties manually, open the Model Properties dialog 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. SeeAbout Source Control with Projects.

Results and Recommended Actions

Condition Recommended Action

The Model Info block contains fields like this:$keyword$

Review the list of fields in the report, then remove the keyword character vectors from the Model Info block.

See Also

Identify Model Info blocks that use the Configuration Manager

Check ID:mathworks.design.ModelInfoConfigurationManager

Use this check to find Model Info blocks that use the Configuration Manager.

Description

Model Info blocks using the Configuration Manager allow risky keyword substitution using external source control tools. 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. The Configuration Manager for the Model Info block will be removed in a future release.

For a more flexible interface to source control tools, use a Simulink project instead of the Model Info block. SeeAbout Source Control with Projects.

Results and Recommended Actions

Condition Recommended Action

A Model Info block is using the Configuration Manager.

ClickRemove the Configuration Manager.

See Also

Check model for upgradableSerDes Toolboxblocks

Check ID:mathworks.design.serdesUpgrades

Lists blocks saved in a previous version of SerDes Toolbox™ that are outdated.

Description

这张支票搜索和列表并行转换器工具箱blocks that can be upgraded for compatibility with the current release.

Results and Recommended Actions

Condition Recommended Action
Blocks saved in older versions of SerDes Toolbox are found. ClickUpgrade SerDes Toolbox Blocksto upgrade the SerDes Toolbox blocks to be compatible with the current release.

Action Results

ClickingUpgrade SerDes Toolbox Blocksupgrades 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

Condition Recommended Action
Blocks configured with old versions of 3DoF or 6DoF blocks found. ClickReplace 3DoF and 6DoF Blocksto replace the blocks with latest versions.

Action Results

ClickingReplace 3DoF and 6DoF Blocksreplaces blocks with the latest versions.

See Also

Check model forAerospace Blocksetnavigation blocks

Check ID:mathworks.design.Aeroblks.CheckNAV

Searches for Three-Axis Inertial Measurement Unit, Three-Axis Gyroscope, and Three-Axis Accelerometer blocks prior to 3.21 (R2018a).

Description

This check searches for Three-Axis Inertial Measurement Unit, Three-Axis Gyroscope, and Three-Axis Accelerometer blocks that have been updated in R2018a.

Results and Recommended Actions

Condition Recommended Action
Three-Axis Inertial Measurement Unit, Three-Axis Gyroscope, and Three-Axis Accelerometer blocks prior to R2018a.

In R2018a or later, if you did not previously solve for steady state conditions, save the model now. If you previously solved for steady state conditions for the model, solve for these steady state conditions again, and then save the model.

See Also

Check and update masked blocks in library to use promoted parameters

Check ID:mathworks.design.CheckAndUpdateOldMaskedBuiltinBlocks

Check for libraries that should be updated to use promoted parameters.

Description

This check searches libraries created before R2011b for masked blocks that should be updated to use promoted parameters. Since R2011b, if a block parameter is not promoted, its value in the linked block is locked to its value in the library block. This check excludes blocks of type Subsystem, Model reference, S-Function and M-S-Function.

Results and Recommended Actions

Condition Recommended Action
Libraries that need to be updated are found ClickUpdate. Once the libraries have been updated, run the check again

Capabilities and Limitations

You can:

  • Run this check on your library models.

  • Exclude blocks and charts from this check if you have aSimulink Checklicense.

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 theimread()函数。

Description

This check searches for the mask display commands that make unnecessary calls to theimread()function, and updates them with mask display commands that do not call theimread()函数。自2013年以来,一个性能和内存optimization is available for mask images specified using the image path instead of the RGB triple matrix.

Results and Recommended Actions

Condition Recommended Action
Mask display commands that make unnecessary calls to theimread()function are found. ClickUpdate. Once the blocks have been updated, run the check again.

Capabilities and Limitations

You can:

  • Run this check on your library models.

  • Exclude blocks and charts from this check if you have aSimulink Checklicense.

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 theRunInitForIconRedrawproperty accordingly. If there is no mask workspace dependency, the value ofRunInitForIconRedrawis set tooff, whereas, if there is mask workspace dependency the values is set toon.

Setting the values ofRunInitForIconRedrawtooffwhen there is no mask workspace dependency optimizes the performance by not executing the mask initialization code before drawing the block icon.

Results and Recommended Actions

Condition Recommended Action

Mask drawing commands that are dependent or independent of the mask workspace are found.

ClickUpdate. Once the blocks have been updated, run the check again.

Capabilities and Limitations

You can:

  • Run this check on your library models.

  • Exclude blocks and charts from this check if you have aSimulink Checklicense.

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

Description

This check identifies masked blocks that use theMaskTabNamesparameter 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

Condition Recommended Action
Masked blocks that use theMaskTabNamesparameter to create tabs programmatically in the mask dialog are found. ClickUpgradeavailable in theActionsection. Once the blocks have been updated, run the check again.

Capabilities and Limitations

You can run this check on your library models.

See Also

Identify questionable operations for strict single-precision design

Check ID:mathworks.design.StowawayDoubles

For a strict single-precision design, this check identifies the blocks that introduce double-precision operations, and non-optimal model settings.

Description

For a strict single-precision design, this check identifies the blocks that introduce double-precision operations, and non-optimal model settings.

Results and Recommended Actions

Condition Recommended Action
Double-precision floating-point operations found in model.

Verify that:

  • Block input and output data types are set correctly.

  • In the Configuration Parameters dialog box,Default for underspecified data typeis set tosingle.

Model uses a library standard that is not optimal for strict-single designs.

Verify that:

  • All target-specific math libraries used by the model support single-precision implementations.

    SetConfiguration Parameters>Standard math librarytoC99 (ISO).

Logic signals are not implemented as Boolean data.

Verify that:

  • In the Configuration Parameters dialog box,Implement logic signals as Boolean datais selected.

Capabilities and Limitations

If you have aSimulink Checklicense, 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 containget_paramfunction calls to return the blockCompiledSampleTimeparameter.

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.

    如果~ iscell blkTs blkTs = {blkTs};对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 containget_param调用输出块编译ample time, Upgrade Advisor displays these results. It suggests that you modify code that accepts the block compiled sample time from multi-rate blocks.

Results and Recommended Actions

Condition Recommended Action
No MATLAB files callget_param(block,CompiledSampleTime) None
Some MATLAB files callget_param(block,CompiledSampleTime) If files use the blockCompiledSampleTimeparameter from multi-rate blocks, modify these files to accept the parameter as a cell array of pairs of doubles

See Also

Check if all simulation outputs are returned as a single Simulink.SimulationOutput object

Check ID:mathworks.design.CheckSingleSimulationOutput

Use this check to identify if the simulation result is returned as a singleSimulink.SimulationOutputobject.

Description

This check scans your model to verify if the parameterReturnWorkspaceOutputsis enabled. Enabling this parameter, returns simulation outputs in aSimulink.SimulationOutputwhen simulating interactively. Simulation outputs include signal, state, output, DSM logging, and scope andTo Workspaceblock logging.

WhenReturnWorkspaceOutputsis enabled, it provides:

  • Easier management of simulation data.

  • Automatic access toSimulationMetadata.

  • Compatibility with multiple parallel simulations and batch simulations.

Results and Recommended Actions

Condition Recommended Action
Simulation outputs are not returned as a singleSimulink.SimulationOutputobject

Return all simulation outputs as a singleSimulink.SimulationOutputobject

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 inIndex Vectorblocks

Results and Recommended Actions

Condition Recommended Action

The model has rate transition issues.

SelectAutomatically handle rate transition for data transferin theSolverpane 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

SelectUpgrade modelto 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-levelInportandOutportblocks in referenced models and Model blocks with virtual bus outputs that require updates to change to nonvirtual bus signals.

If the check identifies issues, clickUpdate Modelto convert root-levelInportandOutportblocks configured for virtual buses to use nonvirtual buses in these situations:

  • For root-levelInportblocks — Enable theOutput as nonvirtual busparameter and insert aSignal Conversionblock after theInportblock. TheSignal Conversionblock is configured to output a virtual bus.

  • For root-levelOutportblocks — Enable theOutput as nonvirtual bus in parent modelparameter.

  • ForModelblocks — For ports whoseOutportblocks were updated to address issues, insert aSignal Conversionblock after the corresponding ports of theModelblock. TheSignal Conversionblock is configured to output a virtual bus.

Recommended Action and Results

To resolve issues, clickUpgrade Model.

Note

Run theAnalyze model hierarchy and continue upgrade sequencecheck on the top-level model and then down through the model reference hierarchy.

ClickingUpgrade Modelconverts affected root-levelInportandOutportblocks configured for virtual buses to use nonvirtual buses in models where you:

  • 使用函数原型控制

  • Perform C++ code generation with theI/O arguments step methodoption.

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

    1. In theConfiguration Parameters>Code Generation>Interfacepane, clickConfigure C++ Class Interface.

    2. In the dialog box, set theFunction specificationparameter toDefault step method.

  • Use buses that have variable-dimension signals

  • Use an associated non-auto storage class forOutportblock 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 anOutportblock is driven by a nonvirtual bus

  • HaveModelblocks that reference models containingOutportblocks that have been fixed — ClickingUpgrade Modelupdates Model blocks referencing the models that hadOutportblocks fixed by theAnalyze model hierarchy and continue upgrade sequencecheck.

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

这张支票搜索自定义库blocks in a model that depend on the frame status of the signal. The check analyzes the blocks, recommends fixes, and gives reasons for the fixes. You must make the fixes manually.

Results and Recommended Actions

Condition Recommended Action

The check finds custom library blocks that depend on the frame status of the signal.

按照推荐的升级isor.

Capabilities and Limitations

You can run this check only on custom library blocks in your model.

You must make the fixes manually.

这张支票似乎只有如果你有DSP系统Toolbox™ installed.

See Also

Frame-based processing(DSP System Toolbox)

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

Condition Recommended Action

Custom-built S-functions are not supported.

Recompile your S-function with available compatible options. SeeCustom-built MEX File Not Supported In Current Releasefor more information.

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

Recompile using the latest flag (mex -R2018a). SeeMEX File Is Compiled With Outdated Optionfor more information.

S-function uses 32-bit functions.

Modify your code according to the instructions inMEX 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). SeeUpgrade MEX Files to Use Interleaved Complex APIfor more information.

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

See Also

UpdateSystem objectsyntax

Check ID:'mathworks.design.CheckSystemObjectUpdate'

Use this check to identify and update any custom MATLAB System object™ in your model that have outdated syntax.

Description

This check scans your model to identify outdated System object syntax. If the check passes, all the syntax is up to date. If the check fails, you can update the syntax.

Results and Recommended Actions

Condition Recommended Action

System object syntax is up to date.

None.

System object syntax requires update.

A report is generated for each unique System object associated with aMATLAB Systemblock. UseUpdateto update the syntax.

See Also

Check Rapid accelerator signal logging

Check ID:mathworks.design.CheckRapidAcceleratorSignalLogging

When simulating your model in rapid accelerator mode, use this check to find signals logged in your model that are globally disabled. Rapid accelerator mode supports signal logging. Use this check to enable signal logging globally.

Description

This check scans your model to see if a simulation is in rapid accelerator mode and whether the model contains signals with signal logging. If the check finds an instance and signal logging is globally disabled, an option to turn on signal logging globally appears.

Results and Recommended Actions

Condition Recommended Action

Simulation mode is not rapid accelerator.

None. You can enable signal logging in rapid accelerator mode.

Simulation mode is rapid accelerator. Upgrade Advisor did not find signals with signal logging enabled.

None. The model does not use signal logging. Enable signal logging for signals and globally if you want to log signals.

Simulation mode is rapid accelerator. Upgrade Advisor found signals with signal logging enabled. However, global setting for signal logging was disabled.

Enable signal logging globally if you want to log signals with signal logging enabled.

Signal logging was already globally enabled.

None.

Action Results

SelectingModifyenables 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 aBus Creatorblock and a rootInportblock. The blocks that cause an error when they have a virtual bus input in this situation are:

  • Assignment

  • Delay

    TheDelayblock causes an error only if you use the Block Parameters dialog box to:

    • Set an initial condition that is a MATLAB structure or zero.

    • 指定a value forState name.

  • Permute Dimension

  • Reshape

  • Selector

  • Unit Delay

    TheUnit Delayblock causes an error only if you use the Block Parameters dialog box to:

    • Set an initial condition that is a MATLAB structure or zero.

    • 指定a value forState name.

  • Vector Concatenate

Results and Recommended Actions

Condition Recommended 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 forState nameis not empty)

  • Permute Dimension

  • Reshape

  • Selector

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

  • Vector Concatenate

In the Upgrade Advisor, clickModify.

The check inserts aBus to Vectorblock 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, seeIdentify Automatic Bus Conversions.

Action Results

ClickingModifyinserts aBus to Vectorblock 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 Pattern Issue Solution

Data Store Memoryblock withData Typeset toInherit: auto

AData Store Memoryblock whose associatedData Store ReadorData Store Writeblocks read or write bus signal data must use a bus object.

In theData Store Memoryblock, set theData Typesignal attribute toBus: .

Signal ConversionblockOutputparameter matches input bus type

ASignal Conversionblock whoseOutputparameter is set toNonvirtual busrequires a virtual bus input.

ASignal Conversionblock whoseOutputparameter is set toVirtual busrequires a nonvirtual bus input.

To create a copy of the input signal, setOutputtoSignal copy.

Merge,Switch, orMultiport Switchblock with multiple bus inputs

Merge,Switch, orMultiport Switchblocks 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.

RootInportblock outputting a virtual bus and specifying a value forPort dimensions

A rootInportblock that outputs to a virtual bus must inherit the dimensions.

Set theInportblockPort dimensionssignal attribute to1or-1 (inherit).

Muxblock with nonvirtual bus inputs

AMuxblock cannot accept nonvirtual bus signals.

To treat the output as an array, replace theMuxblock with aVector Concatenateblock.

If you want a virtual bus output, use aBus Creatorblock to combine the signals.

Bus to Vectorblock without a virtual bus signal input

A nonbus signal does not need aBus to Vectorblock.

Remove theBus to Vectorblock.

Assignmentblock with virtual bus inputs

The Upgrade Advisor converts theAssignmentblockY0port bus input to a vector.

Add aBus to Vectorblock before theAssignmentblock.

S-function using a nonvirtual bus

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

改变the S-function to be a Level-2 C S-function.

Consider using anS-Function Builderblock 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, setData TypetoBus: .

Subsystem with bus operations in a Stateflow chart

AnInportblock inside a subsystem in a Stateflow chart requires a bus object data type if its signal is a bus.

In theInportblock, setData typetoBus: .

Groundblock used as a bus source

The output signal of aGroundblock cannot be a source for a bus.

Use aConstantblock withConstant valueset to 0 and theOutput data typesignal attribute set toBus: .

RootOutportblock with a single-element bus object data type

The input to theOutportblock must be a bus if it specifies a bus object as its data type.

In theOutportblock, setData typetoInherit: 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

Condition Recommended 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.

  • 确定时间常数样本的来源d 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.

ClickContinue Upgrade Sequenceto run the next checks. If there are child models, this will open the next model. Keep clickingContinue Upgrade Sequenceuntil the check passes.

Results and Recommended Actions

Condition Recommended Action
Child models found ClickContinue Upgrade Sequenceto run the next checks. If there are child models, this will close the current Upgrade Advisor session, and open Upgrade Advisor for the next model in the hierarchy.
No child models, but more checks to run If there are no child models, clickContinue Upgrade Sequenceto 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, clickContinue Upgrade Sequenceuntil 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 clickContinue 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 clickingContinue Upgrade Sequenceto 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 clickContinue Upgrade Sequenceto 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 clickContinue Upgrade Sequenceto open the next model. Continue until you reach the end of the hierarchy and this check passes.

See Also

Check Access to Data Stores

Check ID:mathworks.design.ConflictsForDataStoreReadWriters

Identify potential execution order sensitivity when reading and writing to data stores.

Description

The execution order of blocks that read and write to the same data store can change the simulation result. When blocks in the same hierarchy access the same data store, the execution order is not deterministic.

Results and Recommended Actions

Condition Recommended Action

Data Store Memory block accessed by multiple blocks in the same hierarchy.

To enforce execution order for the blocks, consider the following:

  • Add a data dependency between the blocks.

  • Set block priority.

  • Move blocks into separate Function-Call Subsystem blocks and schedule them.

See Also

Check relative execution orders for Data Store Read and Data Store Write blocks

Check ID:mathworks.design.TaskBasedSorting

Check relative execution order changes between legacy and task-based sorting for Data Store Read and Data Store Write blocks.

Description

Legacy models used block sorting to determine block execution order. With task-based sorting, the relative execution order involving Data Store Memory blocks can change. This check detects the changes and provides an option to update your model with the original execution order.

Results and Recommended Actions

Condition Recommended Action
Execution order with a Data Store Memory block changes. You want the original execution order. Click theModifybutton.

See Also

Check for case mismatches in references to models and libraries

Check ID:mathworks.design.CaseSensitiveBlockDiagramNames

Identify and fix case-insensitive references to models and libraries.

Description

Starting R2020a, Simulink model and library names are case-sensitive. This check detects and provides an option to fix case-insensitive references to models and libraries.

Results and Recommended Actions

Condition Recommended Action
The check finds case mismatches in references to models and libraries. 按照推荐的升级isor.

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

Description

Starting R2021a, port positions of the RF Blockset Divider blocks using the Wilkinson power divider component are changed. This check searches and lists the Divider blocks using the Wilkinson power divider component model with broken port connections on port 3 prior to R2021a. You can then rewire the connections using the Modify button.

Results and Recommended Actions

Condition Recommended Action
Models have RF Blockset Divider blocks using the Wilkinson power divider component with broken port connections on port 3. Click theModifybutton to rewire the broken connections on port 3 of the RF Blockset Divider blocks.

Action Results

ClickingModifyrewires the broken port connections on port 3 of the RF Blockset Divider blocks.

Note

TheModifybutton 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 theResultpane of the Upgrade Advisor.

  • The first list enumerates the RF Blockset Divider blocks using the Wilkinson power divider component that require manual rewiring due to model complexity.

  • The second list enumerates the automatically rewired blocks.

  • Fixed and unfixed Divider blocks are temporarily highlighted in colors green and red, respectively. Click theRemove all temporary block highlightinglink at the bottom of theResultpane to remove the highlights.

See Also