Simulink Code Inspector Checks

Simulink Code Inspector Checks Overview

Use Simulink® Code Inspector™ Model Advisor checks to configure your model for code inspection.

See Also

Check code generation settings

Check ID: mathworks.slci.CodeGenerationSettings

Check code generation settings in the model configuration that might impact compatibility with Simulink Code Inspector.

Description

This check verifies that code generation settings are compatible with code inspection.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Verify 'Language' settingThe model is configured to generate C++ (Encapsulated) files.In the Configuration Parameters dialog box, on the Code Generation pane, set Language (Simulink Coder) to C or C++.
Verify 'Code interface packaging’ settingThe model is not configured to use Nonreusable function or Reusable function interface packaging.In the Configuration Parameters dialog box, on the Code Generation > Interface pane, set Code interface packaging (Simulink Coder) to Nonreusable function or Reusable function.
Verify 'Use dynamic memory allocation for model initialization' setting The model is configured to dynamically allocate memory.In the Configuration Parameters dialog box, clear the Use dynamic memory allocation for model initialization (Simulink Coder) field.
Verify 'Shared code placement' settingThe model is not configured to generate shared utility code to a shared location. If shared utility code is generated into model.c, the Simulink Code Inspector reports the code as unverified.In the Configuration Parameters dialog box, on the Code Generation > Interface pane, set Shared code placement (Simulink Coder) to Shared location. Using a shared location for utility functions, macros, and user-defined data types promotes debugging and traceability of generated code.
Verify 'Source file' settingCustom code is configured to appear near the top of the generated model source file.In the Configuration Parameters dialog box, on the Code Generation > Custom Code pane, clear the Source file (Simulink Coder) field.
Verify 'Header file' settingCustom code is configured to appear near the top of the generated model header file.In the Configuration Parameters dialog box, on the Code Generation > Custom Code pane, clear the Header file (Simulink Coder) field.
Verify 'Initialize function' settingCustom code is configured to appear in the generated model initialize function.In the Configuration Parameters dialog box, on theCode Generation > Custom Code pane, clear the Initialize function (Simulink Coder) field.
Verify 'Terminate function' settingCustom code is configured to appear in the generated model terminate function.In the Configuration Parameters dialog box, on the Code Generation > Custom Code and clear the Terminate function (Simulink Coder) field.
Verify 'Disable incompatible optimizations' settingThe model is not configured to disable optimizations that are incompatible with Simulink Code Inspector.In the MATLAB® Command Window, set the model parameter AdvancedOptControl to -SLCI. For example, set_param(gcs, 'AdvancedOptControl', '-SLCI').
Verify 'Combine signal/state structures' settingThe model is configured to combine global block signals and global state data into one data structure in the generated code. This is not supported for code inspection.In the Configuration Parameters dialog box, clear the Combine signal/state structures (Embedded Coder) parameter.
Verify 'Array layout' settingThis model is configured to generate code in row-major layout. This is not supported for code inspection.In the Configuration Parameters dialog box, set the Array layout (Simulink Coder) parameter to column-major.
Verify 'Remove code from floating-point to integer conversions that wraps out-of-range values' settingThe model is configured not to remove wrapping code that handles out-of-range floating-point to integer conversion results when out-of-range conversions occur.In the Configuration Parameters dialog box, on the Code Generation > Optimization pane, select Remove code from floating-point to integer conversions that wraps out-of-range values (Simulink Coder).
Verify 'Remove code from floating-point to integer conversions with saturation that maps NaN to zero' settingThe model is configured to remove code that handles floating-point to integer conversion results for NaN values when mapping from NaN to integer zero occurs.In the Configuration Parameters dialog box, clear the Remove code from floating-point to integer conversions with saturation that maps NaN to zero (Simulink Coder) parameter.
Verify 'Include comments' settingThe model is configured to omit autogenerated comments from generated code files. The Simulink Code Inspector parses autogenerated comments to obtain traceability information about model data.In the Configuration Parameters dialog box, on the Code Generation > Comments pane, select Include comments (Simulink Coder).
Verify 'Generate scalar inlined parameter as' settingThe model is configured to generate scalar inlined parameters as variables with #define macros, rather than as numeric constants.In the Configuration Parameters dialog box, on the Code Generation > Identifiers pane, set Generate scalar inlined parameter as (Embedded Coder) to Literals.
Verify 'Preserve condition expression in if statement' settingThe model is configured to optimize empty primary condition expressions in if statements by negating them, rather than preserving the empty primary condition expressions.In the Configuration Parameters dialog box, on the Code Generation > Code Style pane, select Preserve condition expression in if statement (Embedded Coder).
Verify 'Code replacement library' settingA code replacement library other than None is selected for the model.In the Configuration Parameters dialog box, on the Code Generation > Interface pane, set Code replacement library (Simulink Coder) to None. The check does not pass if you do not select None. However, if you create your library using Supported Functions and Operations in Code Replacement Libraries, Simulink Code Inspector does inspect the generated code.
Verify 'Standard math library' settingA standard math library other than C89/C90 (ANSI) or C99 (ISO) is selected for the model.In the Configuration Parameters dialog box, set Standard math library (Simulink Coder) to C89/C90 (ANSI) or C99 (ISO).
Verify 'Classic call interface' settingThe model is configured to generate model function calls compatible with the main program module of a pre-R2011a GRT target. The classic call interface is not supported for code inspection.In the Configuration Parameters dialog box, clear the Classic call interface (Simulink Coder) parameter.
Verify 'Terminate function required' settingThe model is configured to generate a model_terminate function, potentially containing model termination code to be executed during system shutdown. This is not supported for code inspection.In the Configuration Parameters dialog box, clear the Terminate function required (Embedded Coder) parameter.
Verify 'Remove code that protects against division arithmetic exceptions' settingThe model is configured to remove code that guards against division by zero for fixed-point data.In the Configuration Parameters dialog box, on the Code Generation > Optimization pane, clear the Remove code that protects against division arithmetic exceptions (Embedded Coder) parameter.
Verify 'MAT-file logging' settingThe model is configured to log execution data to a MAT-file. This is not supported for code inspection.In the Configuration Parameters dialog box, clear the MAT-file logging (Simulink Coder) parameter.
Verify 'Pack Boolean data into bitfields' settingThe model is configured to store Boolean signals as one-bit bitfields.In the Configuration Parameters dialog box, on the Code Generation > Optimization pane, clear the Pack Boolean data into bitfields (Embedded Coder) parameter.
Verify ‘Use bitsets for storing state configuration’ settingThe model is configured to reduce the amount of memory required to store state configuration variables.In the Configuration Parameters dialog box, on the Code Generation > Optimization pane, clear the Use bitsets for storing state configuration (Simulink Coder) parameter.
Verify 'non-finite numbers' settingThe model is configured to generate nonfinite data (for example, NaN and Inf) and related operations. This is not supported for code inspection.In the Configuration Parameters dialog box, on the Code Generation > Interface pane, clear the Support: non-finite numbers (Simulink Coder) parameter.
Verify 'absolute time' settingThe model is configured to generate and maintain integer counters for absolute and elapsed time values. This is not supported for code inspection.In the Configuration Parameters dialog box, on the Code Generation > Interface pane, clear the Support: absolute time (Embedded Coder) parameter.
Verify 'Operator to represent Bitwise and Logical Operator blocks' settingThe model is configured to generate code that represents bitwise operators as logical operator.In the Configuration Parameters dialog box, on the Code Generation > Interface pane, set Operator to represent Bitwise and Logical Operator blocks (Embedded Coder) to Same as modeled or Bitwise operator.
Verify ‘Default parameter behavior’ settingThe referenced model is configured to use symbolic names for model parameters in generated code.In the Configuration Parameters dialog box, set Default parameter behavior (Simulink Coder) to Inlined.
Verify 'Remove error status field in real-time model data structure' settingThe model is configured to include an error status field in a generated rtModel data structure. The rtModel data structure is not supported for code inspection.In the Configuration Parameters dialog box, on the Code Generation > Interface pane, select Remove error status field in real-time model data structure (Embedded Coder).
Verify 'Create block' settingThe model is configured to generate a SIL or PIL block during code generation. This is not supported for code inspection.In the Configuration Parameters dialog box, set Create block (Embedded Coder) to None.
Verify 'Measure function execution times' settingThe model is configured to generate code with instrumentation to collect execution times for functions inside the generated code. This is not supported for code inspection.In the Configuration Parameters dialog box, on the Code Generation > Verification pane, clear the Measure function execution times (Embedded Coder) parameter.
Verify 'Signal naming' settingThe model is configured to change signal names when creating corresponding identifiers in the generated code.In the Configuration Parameters dialog box, on the Code Generation > Identifiers pane, set Signal naming (Embedded Coder) to None.
Verify 'Parameter naming' settingThe model is configured to change parameter names when creating corresponding identifiers in the generated code.In the Configuration Parameters dialog box, on the Code Generation > Identifiers pane, set Parameter naming (Embedded Coder) to None.
Verify 'TLC options' settingThe model is configured with TLC options.In the MATLAB Command Window, set the model configuration parameter TLCOptions to unspecified or -aMaxStackVariableSize=inf. For example, set_param(gcs, 'TLCOptions', ' ') or set_param(gcs, 'TLCOptions', '-aMaxStackVariableSize=inf').
Verify ‘variable-size signals’ settingThe model is configured to generate code for models that use variable-size signals.In the Configuration Parameters dialog box, on the Code Generation pane, clear the Support: variable-size signals (Embedded Coder) field.
Verify 'Single output/update function' settingThe model is configured to generate code in separate model_output and model_update functions, rather than a model_step function that combines the two.In the Configuration Parameters dialog box, select Single output/update function (Simulink Coder).
Verify ‘Casting Modes’ settingThe model is configured to generate code that casts data type values explicitly.In the Configuration Parameters dialog box, on the Code Generation > Code Style pane, set Casting Modes (Embedded Coder) to Nominal or Standards.
Verify 'Suppress generation of default cases for Stateflow switch statements if unreachable' settingThe model is configured to generate default cases for switch-case statements in the code for Stateflow® charts.In the Configuration Parameters dialog box, on the Code Generation> Code Style pane, clear the Suppress generation of default cases for Stateflow switch statements if unreachable (Embedded Coder) field.
Verify ‘Optimize using the specified minimum and maximum values’ settingThe model is configured to optimize generated code using range information derived from the minimum and maximum specified values for signals and parameters in the model.In the Configuration Parameters dialog box, on the Code Generation > Optimization pane, clear the Optimize using the specified minimum and maximum values (Embedded Coder) parameter.
Verify ‘parameters’ setting

Model is configured to generate a C API interface to global block parameters.

In the Configuration Parameters dialog box, on the Code Generation > Interface pane, clear Generate C API for: parameters (Simulink Coder).
Verify ‘signals’ setting

Model is configured to generate a C API interface to global block outputs.

In the Configuration Parameters dialog box, on the Code Generation > Interface pane, clear Generate C API for: signals (Simulink Coder).
Verify ‘states’ setting

Model is configured to generate a C API interface to discrete and continuous states.

In the Configuration Parameters dialog box, on the Code Generation > Interface pane, clear Generate C API for: states (Simulink Coder).
Verify ‘root-level I/O’ setting

Model is configured to generate a C API interface to root-level inputs and outputs.

In the Configuration Parameters dialog box, on the Code Generation > Interface pane, clear Generate C API for: root-level I/O (Simulink Coder).
Verify ‘External mode’ setting

Model is configured to generate code for the external mode data interface.

In the Configuration Parameters dialog box, on the Code Generation > Interface pane, clear External mode (Simulink Coder).
Verify ‘ASAP2 interface’ setting

Model is configured to generate code for the ASAP2 data interface.

In the Configuration Parameters dialog box, on the Code Generation > Interface pane, clear ASAP2 interface (Simulink Coder).
Verify 'Generate an example main program' settingModel is not configured to generate an example main program.In the Configuration Parameters dialog box, on the Code Generation > Templates pane, select Generate an example main program (Embedded Coder).
Verify ‘Use bitsets for storing Boolean data’ settingThe model is configured to use bitsets for storing Boolean data.In the Configuration Parameters dialog box, on the Code Generation > Optimization pane, clear the Use bitsets for storing Boolean data (Simulink Coder) parameter.
Verify 'Simplify array indexing' settingThe model is configured to generate code that replaces multiply operations with add operations in array indices when accessing arrays in a loop.In the Configuration Parameters dialog box, clear the Simplify array indexing (Embedded Coder) parameter.
Verify 'Rate Transition block code' settingThe model is configured to separate Rate Transition block code and data from the model code and data.In the Configuration Parameters dialog box, on the Code Generation > Code Placement pane, set Rate Transition block code (Embedded Coder) to Inline.

See Also

Simulink Configuration Parameter Constraints

Check data import/export settings

Check ID: mathworks.slci.DataImportSettings

Check data import/export settings in the model configuration that might impact compatibility with Simulink Code Inspector.

Description

This check verifies that data import/export settings are compatible with code inspection.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Verify 'Initial state' settingThe model is configured to load initial states from a workspace, which is not compatible with code inspection.In the Configuration Parameters dialog box, on the Data Import/Export pane, clear the Initial state parameter.

See Also

Simulink Configuration Parameter Constraints

Check diagnostic settings

Check ID: mathworks.slci.DiagnosticsSettings

Check diagnostic settings in the model configuration that might impact compatibility with Simulink Code Inspector.

Description

This check verifies that diagnostic settings are compatible with code inspection.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Verify ‘Multitask data store’ settingThe model is not configured to generate an error when one task reads data from a Data Store Memory block to which another task writes data.In the Configuration Parameters dialog box, on the Diagnostics > Data Validity pane, set Multitask data store to error.
Verify ‘Multitask rate transition’ settingThe model is not configured to generate an error when an invalid rate transition occurred between two blocks operating in multitasking mode.In the Configuration Parameters dialog box, on the Diagnostics > Sample Time pane, set Multitask rate transition to error.
Verify ‘Multitask conditionally executed subsystem’ settingThe model is not configured to generate an error when the Simulink software detects a subsystem that may cause data corruption or non-deterministic behavior.In the Configuration Parameters dialog box, on the Diagnostics > Sample Time pane, set Multitask conditionally executed subsystem to error.
Verify 'Underspecified initialization detection' settingThe model is not configured to initialize block initial conditions using simplified behavior. The simplified behavior can improve the consistency of model results.In the Configuration Parameters dialog box, set Underspecified initialization detection to Simplified.
Verify 'Non-bus signals treated as bus signals' settingThe model is not configured to generate an error when Simulink software implicitly converts a non-bus signal to a bus signal to support connecting the signal to a Bus Assignment or Bus Selector block.In the Configuration Parameters dialog box, on the Diagnostics > Connectivity pane, set Non-bus signals treated as bus signals to error.
Verify 'Detect downcast' settingThe model is not configured to generate an error when a parameter downcast occurs during simulation.In the Configuration Parameters dialog box, on the Diagnostics > Data Validity pane, set Detect downcast to error.
Verify 'Detect overflow' settingThe model is not configured to generate an error when a parameter overflow occurs during simulation.In the Configuration Parameters dialog box, on the Diagnostics > Data Validity > Parameters pane, set Detect overflow to error.
Verify 'Detect overflow' settingThe model is not configured to generate an error when a signal overflow occurs during simulation.In the Configuration Parameters dialog box, on the Diagnostics > Data Validity > Signals pane, set Wrap on overflow to error.
Verify 'Saturate on overflow' settingThe model is not configured to generate an error when the value of a signal is too large to be represented by the signal data type, resulting in a saturation.In the Configuration Parameters dialog box, on the Diagnostics > Data Validity > Signals pane, set Saturate on overflow to error.
Verify 'Detect underflow' settingThe model is not configured to generate an error when a parameter underflow occurs during simulation.In the Configuration Parameters dialog box, on the Diagnostics > Data Validity pane, set Detect underflow to error.
Verify 'Detect loss of tunability' settingThe model is not configured to generate an error when an expression with tunable variables is reduced to its numerical equivalent.In the Configuration Parameters dialog box, on the Diagnostics > Data Validity pane, set Detect loss of tunability to error.
Verify 'Unexpected backtracking' setting

The model is not configured to generate an error when a chart junction:

  • Does not have an unconditional transition path to a state or a terminal junction

  • Has multiple transition paths leading to it

In the Configuration Parameters dialog box, on the Diagnostics > Stateflow pane, set Unexpected backtracking to error.
Verify 'Invalid input data access in chart initialization' setting

The model is not configured to generate an error when a chart:

  • Has the ExecuteAtInitialization property set to true

  • Accesses input data on a default transition or associated state entry actions, which execute at chart initialization

In the Configuration Parameters dialog box, on the Diagnostics > Stateflow pane, set Invalid input data access in chart initialization to error.
Verify 'No unconditional default transitions' setting The model is not configured to generate an error when a chart does not have an unconditional default transition to a state or a junction.In the Configuration Parameters dialog box, on the Diagnostics > Stateflow pane, set No unconditional default transitions to error.
Verify 'Transition outside natural parent' settingThe model is not configured to generate an error when a chart contains a transition that loops outside the parent state or junction.In the Configuration Parameters dialog box, on the Diagnostics > Stateflow pane, set Transition outside natural parent to error.
Verify ‘Unreachable execution path’ settingThe model is not configured to generate an error when a chart construct is not on a valid execution path.In the Configuration Parameters dialog box, on the Diagnostics > Stateflow pane, set Unreachable execution path to error.
Verify 'Undirected event broadcasts' settingThe model is not configured to generate an error when a chart contains undirected local event broadcasts.In the Configuration Parameters dialog box, on the Diagnostics > Stateflow pane, set Undirected event broadcasts to error.
Verify 'Transition action specified before condition action' settingThe model is not configured to generate an error when a transition action executes before a condition action in a transition path with multiple transition segments.In the Configuration Parameters dialog box, on the Diagnostics > Stateflow pane, set Transition action specified before condition action to error.
Verify Bus signal treated as vector settingThe model is not configured to generate an error when Simulink software detects a virtual bus signal that is used as a mux signal. Strict bus behavior is not enforced.In the Configuration Parameters dialog box, on the Diagnostics > Connectivity pane, set Bus signal treated as vector to error.
Verify 'Allow symbolic dimension specification' settingsThe model is configured to allow symbolic dimension specification.In the Configuration Parameter dialog box, clear the Allow symbolic dimension specification field.

See Also

Simulink Configuration Parameter Constraints

Check hardware implementation settings

Check ID: mathworks.slci.HardwareImplementationSettings

Check hardware implementation settings in the model configuration that might impact compatibility with Simulink Code Inspector.

Description

This check verifies that hardware implementation settings are compatible with code inspection.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Verify 'char' settingThe bit length of character data for the production hardware does not equal 8.In the Configuration Parameters dialog box, on the Hardware Implementation pane, select a production hardware Device type that is compatible with the settings in this table.
Verify 'short' settingThe bit length of short data for the production hardware does not equal 16.
Verify 'int' settingThe bit length of int data for the production hardware does not equal 32.
Verify 'long' settingThe bit length of long data for the production hardware does not equal 32.
Verify 'float' settingThe bit length of floating-point data for the production hardware does not equal 32.
Verify 'double' settingThe bit length of double data for the production hardware does not equal 64.
Verify 'pointer' settingThe bit length of pointer data for the production hardware does not equal 32.
Verify 'native' settingThe microprocessor native word size for the production hardware does not equal 32 bits.
Verify 'Signed integer division rounds to' settingThe method of producing a signed integer quotient for the production hardware is not to choose the integer that is closer to zero (Zero method).
Verify 'Shift right on a signed integer as arithmetic shift' settingThe method by which the compiler implements signed integer right shift for the production hardware is not an arithmetic right shift.
Verify ‘Support long long’ settingThe use of C long long data type is enabled.In the Configuration Parameters dialog box, on the Hardware Implementation pane, do not select Support long long.
Verify 'Test hardware is the same as production hardware' settingThe test hardware differs from the deployment hardware.In the Configuration Parameters dialog box, select Test hardware is the same as production hardware.
Verify 'Device vendor->Device type‘ settingThe device vendor and device type are ASIC/FPGA.

In the Configuration Parameters dialog box, on the Hardware Implementation pane, under Test hardware, do not select Device vendor ASIC/FPGA.

See Also

Simulink Configuration Parameter Constraints

Check math and data types settings

Check ID: mathworks.slci.MathandDataTypesSettings

Check math and data type settings in the model configuration that might impact compatibility with Simulink Code Inspector.

Description

This check verifies that math and data type settings are compatible with code inspection.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Verify 'Implement logic signals as Boolean data (vs. double)' settingThe model is configured to implement logic signals with the double data type, rather than with the more memory-efficient boolean data type.In the Configuration Parameters dialog box, select Implement logic signals as Boolean data (vs. double).

See Also

Simulink Configuration Parameter Constraints

Check solver settings

Check ID: mathworks.slci.SolverSettings

Check solver settings in the model configuration that might impact compatibility with Simulink Code Inspector.

Description

This check verifies that solver settings are compatible with code inspection.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Verify 'Type' settingThe model is configured with a variable-step solver.In the Configuration Parameters dialog box, on the Solver pane, set Type to Fixed-step.
Verify 'Solver' settingThe model is configured with a solver other than a fixed-step discrete solver.In the Configuration Parameters dialog box, on the Solver pane, set Solver to discrete (no continuous states) (equivalent to FixedStepDiscrete specified at the command line).
Verify ‘Periodic sample time constraint’ settingThe model sets Periodic sample time constraint to Specified.In the Configuration Parameters dialog box, on the Solver pane, set Periodic sample time constraint to Unconstrained or Ensure sample time independent.
Verify ‘Automatically handle rate transition for data transfer’ settingThe model is configured to insert hidden Rate Transition blocks between blocks when rate transitions are detected. In the Configuration Parameters dialog box, on the Solver pane, clear the Automatically handle rate transition for data transfer check box.
Verify ‘Allow tasks to execute concurrently on target’ settingThe model configuration parameter Allow tasks to execute concurrently on target (ConcurrentTasks) is selected. In the Configuration Parameters dialog box, on the Solver pane, clear the Allow tasks to execute concurrently on target check box.

See Also

Simulink Configuration Parameter Constraints

Check for unconnected objects in the model

Check ID: mathworks.slci.UnconnectedObjects

Check for unconnected ports and lines in the model.

Description

This check reports unconnected lines, input ports, and output ports in the model or subsystem.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Check for unconnected objectsOne or more lines, input ports, or output ports are not properly connected in the model or subsystem. This can result in dead code or hidden ground blocks.Connect or remove the affected blocks.

See Also

Model-Wide Attribute Constraints

Check system target file setting

Check ID: mathworks.slci.SystemTargetFileSettings

Check for unconnected ports and lines in the model.

Check whether a compatible system target file is selected for the model.

Description

This check verifies that the System target file selected for the model is ert.tlc or is derived from ert.tlc.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Verify system target file settingThe system target file selected for the model is not ert.tlc or an ERT-derived target.In the Configuration Parameters dialog box, on the Code Generation pane, set System target file (Simulink Coder) to ert.tlc or an ERT-derived target.

See Also

Simulink Configuration Parameter Constraints

Check function specification setting

Check ID: mathworks.slci.FcnSpecSettings

Check for function specification settings that might impact compatibility with Simulink Code Inspector.

Description

This check verifies that function prototype control settings are compatible with code inspection.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Check C Step Function Interface settingThe model specifies custom function prototypes for model entry functions. This is not supported for code inspection.In the Simulink Editor code perspective, in the Code Mapping Editor, select the Functions tab. In the row for the step function, click in the function in the Function Preview column. In the Configure C Step Function Interface dialog box, clear the Configure arguments for Step function prototype setting.

See Also

Model-Wide Attribute Constraints

Check for Stateflow machine data

Check ID: mathworks.slci.StateflowMachineData

Check the model for Stateflow data of machine scope. Data of machine scope is incompatible with Simulink Code Inspector

Description

This check verifies that the model does not contain Stateflow data of machine scope.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
All Stateflow data must be parented by a Stateflow chartThe model contains Stateflow data of machine scope.Modify model so that it does not contain Stateflow data of machine scope.

See Also

Data Specification (Stateflow)

Check for Stateflow machine events

Check ID: mathworks.slci.StateflowMachineEvents

Check the model for Stateflow events of machine scope. Events of machine scope are incompatible with Simulink Code Inspector

Description

This check verifies that the model does not contain Stateflow events of machine scope.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
All Stateflow events must be parented by a Stateflow chartThe model contains Stateflow events of machine scope.Modify model so that it does not contain Stateflow events of machine scope.

See Also

Events (Stateflow)

Check conditional input branch execution setting

Check ID: mathworks.slci.ConditionallyExecuteInputs

Check for usage of conditional input branch execution that might impact compatibility with Simulink Code Inspector.

Description

This check updates the model diagram and reports incompatible usage of conditional input branch execution.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Verify conditional input branch execution settingThe model configuration parameter Conditional input branch execution is selected, but Enable local block outputs (Simulink Coder) is not selected. The model must enable local block outputs when using conditional input branch execution.In the Configuration Parameters dialog box, on the Optimization pane, select Enable local block outputs (Simulink Coder).
Verify that Reusable or Nonreusable subsystem block outputs are not inputs to Multiport Switch blocks when Conditional input branch execution model configuration parameter is selectedThe model uses Reusable or Nonreusable subsystem block outputs as inputs to the Multiport Switch block when the model configuration parameter Conditional input branch execution is selected.Modify the model so that the Reusable or Nonreusable subsystem block outputs are not inputs to the Multiport Switch block.

See Also

Model-Wide Attribute Constraints

Check model for instrumented signals that connect to automatically inserted blocks

Check ID: mathworks.slci.InstrumentedSignals

Check for instrumented signals in the model that connect to automatically inserted blocks.

Description

This check verifies that the model does not contain signals that are instrumented, and connect to automatically inserted blocks. Automatically inserted blocks are referred to as hidden blocks.

Results and Recommended Actions

SubcheckConditionRecommended Action
Check for instrumented signals in the model that connect to automatically inserted blocksThe model contains instrumented signals that connect to automatically inserted blocks.Modify the model by deleting the instrumented signals that connect to automatically inserted blocks.

See Also

Model-Wide Attribute Constraints

Check the code generation folder structure for the model

Check ID: mathworks.slci.CodeGenFolderStructure

Check for unsupported code generation folder structure for the model.

Description

This check verifies that, in Simulink Preferences, the Code generation folder structure is set to Model Specific for the model.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Check the code generation folder structure for the modelThe model has an unsupported code generation folder structure.In Simulink Preferences, on the General pane, set the Code generation folder structure to Model Specific.

See Also

Model-Wide Attribute Constraints

Check for unsupported Code Mappings settings

Check ID: mathworks.slci.CodeMappingDefaults

Check for unsupported Code Mapping settings.

Description

This check verifies that the Default storage class is used for each model element category on the Data Defaults tab of the Code Mapping Editor.

Results and Recommended Actions

SubcheckConditionRecommended Action
Check for unsupported Code Mapping settingsModel element categories use an unsupported storage class setting on the Data Defaults tab of the Code Mapping Editor.In the Code Mapping Editor, on the Data Defaults tab under Code Mappings-C, set the storage class to Default for each model element category.

See Also

Model-Wide Attribute Constraints

Check model arguments for storage classes

Check ID: mathworks.slci.StructureStorageClass

Check for model arguments with a storage class.

Description

This check verifies that model arguments do not have a storage class.

Results and Recommended Actions

SubcheckConditionRecommended Action
Check model arguments for storage classesA model argument has a storage class.Modify the model so that model arguments do not have storage classes.

See Also

Model-Wide Attribute Constraints

Check usage of Code in MATLAB Functions

Check ID: mathworks.slci.MATLABFunctionCodeUsage

Identify code in MATLAB functions that might impact compatibility with Simulink Code Inspector.

Description

This check updates the model diagram and reports incompatibilities it finds with code in MATLAB functions.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Check non-inlined user defined functions with global variables in MATLAB codeUse of non-inlined user-defined functions with global variables is not supported.
  • Modify the MATLAB code so that non-inlined user defined functions do not have global variables inside a reusable or void-void subsystem.

  • Set model parameter Code interface packaging (CodeInterfacePackaging) to Nonreusable function.

Check that non-inlined user defined functions in MATLAB code contain only one output Non-inlined functions define more than one output.Modify the MATLAB code so that non-inlined user defined functions define only one output.
Check that array subscripting in MATLAB code uses a constant index of 1 for a corresponding dimension of size 1Array subscript in MATLAB code uses an index value other than 1 for the corresponding array dimension of size 1.Modify the MATLAB code so that array subscripting uses a constant index of 1 for a corresponding dimension of size 1.
Check that array indexing in MATLAB code uses a subscript that is less than or equal to the array base dimensionArray index in MATLAB code uses a subscript that is greater than the array base dimensionModify the MATLAB code so that array indexing uses a subscript that is less than or equal to the array base dimension.
Check type argument for cast in MATLAB functionsMATLAB function has unsupported type argument in cast functions.

Modify the cast function to one of the following forms:

  • cast(A,'newclass')

  • cast(A,'like',p)

Check that colon operators in MATLAB code have no more than 3 operandscolon (:) operator has more than 3 operands.

Modify MATLAB code so that colon (:) operators do not have more than 3 operands.

Check that colon operators in MATLAB code use only integer and double datacolon (:) operator uses single or char data.

Modify MATLAB code so that colon (:) operators use integer or double data.

Check that data used in MATLAB function is of a supported data typeData used in MATLAB function is not of type: boolean, int8, int16, int32, uint8, uint16, uint32, single, double, or scalar bus.Modify the data to be a supported data type.
Check that diagonal number used in a diag function in MATLAB code is constantdiag function specifies a diagonal number that is not a constant.Modify the diag function to use a constant diagonal number.
Check that code in MATLAB function is of a supported dimension
  • Identifiers used in assignment, array, function call arguments, and function definition arguments have dimension greater than 2–D.

  • Identifiers used in any other context are vector, matrix, or have dimension greater than 2–D.

Modify the identifiers to be a supported dimension.
Check that if statements in MATLAB code use conditions that are scalarif statement uses condition that is not scalar.Modify MATLAB code so that if statements use conditions that are scalar.
Check for nonempty brackets in MATLAB codeMATLAB code contains empty brackets.Modify MATLAB code so that there are not empty brackets.
Check that for statements in MATLAB code have index ranges that are mono incremental colon expressionsMATLAB code contains for statements with index ranges that are not mono incremental colon expressions.Modify MATLAB code so that for statements have index ranges that are mono incremental colon expressions.
Check that for statements in MATLAB code have index range values that are literal const integersMATLAB code contains for statements with index range values that are not literal const integers.Modify MATLAB code so that for statements have index range values that are literal const integers.
Check that for statements in MATLAB code have scalar index valuesMATLAB code contains for statements with non-scalar index values.Modify MATLAB code so that for statements have scalar index values.
Check that data defined in MATLAB function is of a double or single data typeOperands of dot power operator are not of type single or double.Modify the data to a supported data type of single or double.
For MATLAB root function, do not specify coder.inline directive or set coder.inline directive to 'always'. For user defined MATLAB functions, explicitly set coder.inline directive to 'always' or 'never'MATLAB function does not use supported coder.inline directive.

Modify use of coder.inline directive.

For MATLAB root functions, if coder.inline directive is specified, it must be set to always.

For user-defined MATLAB functions, the coder.inline directive must be explicitly set to always or never.

Check that math functions in MATLAB code use only integer and floating-point dataMath functions in MATLAB code are using boolean type data.Modify MATLAB code so that math functions use only integer or double data.
Check that no code in MATLAB functions has missing data type informationMATLAB function has missing data type information.

Modify the function to eliminate code with missing data type information.

Note

If your MATLAB code fails this check, it might be because there is unreachable code. Fix any mlint warning related to unreachable code to resolve the incompatibility.

Check that no code in MATLAB functions has missing dimension informationMATLAB function has missing dimension information.

Modify the function to eliminate code with missing dimension information.

Note

If your MATLAB code fails this check, it might be because there is unreachable code. Fix any mlint warning related to unreachable code to resolve the incompatibility.

Check that all function calls in MATLAB code resolve to a known function definitionMATLAB function has a function call that does not resolve to a known function definition.Modify the MATLAB function to eliminate function calls with unknown function resolution.
Check that operators used in MATLAB function do not have operands with mixed data typeOperator in MATLAB function has operands with mixed data type.Modify the function to avoid using operators with operands of mixed data type.
Check that the ‘Loop unrolling threshold’ does not result in partially unrolled loops in the generated code when using matrix operations in MATLAB codeWhen using matrix operations, the Loop unrolling threshold might result in partially unrolled loops in the generated code.Modify the Loop unrolling threshold to generate code without partially unrolled loops for matrix operations.
Check that conditional initialization of persistent variables uses an 'if' statement with a single isempty (persistent) or ~isempty (persistent) conditionConditional initialization of a persistent variable does not use an if statement with a single isempty(persistent) or ~isempty(persistent) condition.Modify the if statement to use a single isempty(persistent) or ~isempty(persistent) condition.
Check that there is only one initialization statement of a persistent variable in ‘if’ statement bodyif statement body contains multiple initialization statements for a persistent variable.Modify the MATLAB code so that conditional initialization of persistent variables contains one statement in if statement body.
Check that switch statements in MATLAB code do not have case expressions containing a cell arrayswitch statement has a case expression containing a cell array.Modify MATLAB code so that switch statements do not have case expressions containing a cell array.
Check that switch statements in MATLAB code use the same scalar integer type for all conditionsswitch statement does not use the same scalar integer type for switch and case conditions.Modify MATLAB code so that switch statements have conditions that use the same scalar integer type.
Check that operators and functions in MATLAB code have supported operand dimensionsThe colon (:) function or a division operation in MATLAB code uses unsupported non-scalar operands.Modify the function to use scalar operands.
Check for unsupported MATLAB code in MATLAB functionsMATLAB function contains unsupported MATLAB code.Modify the function to remove the use of unsupported MATLAB code.
Check usage of recursive functions in MATLAB codeMATLAB code defines recursive functions.Modify the MATLAB code so that it does not define recursive functions.
Check that coder.ceval in MATLAB code does not specify '-global' optionA usage of coder.ceval specifies the -global option.Modify coder.ceval to remove the -global option.
Check that coder.ceval in MATLAB code does not specify layout optionA usage of coder.ceval specifies the layout option.Modify coder.ceval to remove the layout option.
Check usage of function call outputs in MATLAB codeSubfunctions in MATLAB code call function call outputs.Modify the MATLAB code so that only top-level function has function call outputs.
Check usage of inner functions in MATLAB codeMATLAB code defines inner functions.Modify the MATLAB code so that it does not define inner functions.

See Also

Check MATLAB Code Analyzer messages

Check ID: mathworks.slci.MATLABCodeAnalyzer

Check MATLAB functions for %#codegen directive, MATLAB Code Analyzer messages, and justification message ID’s.

Description

This check reports on %#codegen directives, MATLAB Code Analyzer messages, and justification message ID’s found in MATLAB functions and MATLAB Function blocks.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Check MATLAB code used in MATLAB Function blocksIssues in MATLAB Function block.
  • Implement MATLAB Code Analyzer recommendations.

  • Justify code line with %#ok comment.

  • Specify justification by adding message id to %#ok comment.

Check MATLAB functions defined in Stateflow chartsIssues with MATLAB function used in Stateflow charts.
  • Implement MATLAB Code Analyzer recommendations.

  • Justify code line with %#ok comment.

  • Specify justification by adding message id to %#ok comment.

Check called MATLAB functionsIssues in called MATLAB functions.
  • Add %#codegen directive, if missing.

  • Implement MATLAB Code Analyzer recommendations.

  • Justify code line with %#ok comment.

  • Specify justification by adding message id to %#ok comment.

See Also

Check for unsupported blocks

Check ID: mathworks.slci.UnsupportedBlocks

Check for blocks that are not supported by Simulink Code Inspector.

Description

This check updates the model diagram and reports blocks that are not supported by Simulink Code Inspector.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Check for blocks not supported by Simulink Code Inspector

One or more blocks in the model are not supported for code inspection.

Note

Supported blocks are listed in Supported Blocks — By Category and Supported Mask Blocks, and also can be viewed in the slcilib block library.

Possible actions include:

  • Replace an unsupported block with a supported block.

  • Replace an unsupported block with an equivalent combination of supported blocks.

  • Replace an unsupported block with an S-Function block created using the Legacy Code Tool.

  • If one or more unsupported blocks cannot be removed, use referenced models to isolate the unsupported block(s), and/or use a partial verification work flow that omits the unsupported block(s).

Capabilities and Limitations

You can run this check on your library models.

Edit-Time Checking

This check is supported by edit-time checking.

See Also

Check storage class for workspace variables

Check ID: mathworks.slci.WorkspaceVarUsage

Check for workspace variables referenced by the model.

Description

This check reports workspace variables that use unsupported storage classes.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Check storage class for workspace variables referenced by the model

Workspace variables referenced by the model are not supported for one of these reasons:

  • Custom storage class Type is not set to Unstructured.

  • Custom storage class is reusable.

Note

In Simulink or module packaging tool (MPT) classes shipped with MathWorks® code, code inspection is supported for the following storage classes:

  • Global

  • Const

  • Volatile

  • ConstVolatile

  • Define

  • ImportedDefine

  • ExportTofile

  • GetSet

Modify the model so that the model does not reference workspace variables or set the workspace variable custom storage class Type to Unstructured.

See Also

Model-Wide Attribute Constraints

Check for sample times in the model

Check ID: mathworks.slci.SampleTimesUsage

Check for sample time characteristics that might impact compatibility with Simulink Code Inspector.

Description

This check updates the model diagram and reports instances of variable, continuous, union, exported discrete, or asynchronous sample times.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Check sample timesThe model is using continuous, asynchronous, explicit discrete partition, data driven, union, exported discrete, or variable sample times. This is not supported for code inspection.Modify the model to use supported sample times.
Check for explicit partitionsThe model contains explicit partitions.Modify the model so that it does not contain explicit partitions.

See Also

Model-Wide Attribute Constraints

Check for unsupported Signal Conversion blocks automatically inserted on signals entering block input ports

Check ID: mathworks.slci.HiddenBufferBlock

Check for hidden Signal Conversion blocks that might impact compatibility with Simulink Code Inspector.

Description

This check updates the model diagram and reports hidden Signal Conversion blocks that have been automatically inserted on signals entering block input ports.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Verify no unsupported Signal Conversion blocks are automatically inserted on signals entering block inportsA hidden Signal Conversion block has been automatically inserted on a signal entering a block inport. Hidden Signal Conversion blocks are not supported for code inspection.Manually insert a Signal Conversion block on the signal entering the block inport, and configure the Signal Conversion block to be excluded from block reduction.

See Also

Model-Wide Attribute Constraints

Check for usage of fixed-point instrumentation

Check ID: mathworks.slci.MinMaxLogging

Check for usage of fixed-point instrumentation that might impact compatibility with Simulink Code Inspector.

Description

This check updates the model diagram and reports fixed-point instrumentation incompatibilities.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Verify usage of fixed-point instrumentationThe model configuration parameter Block reduction (BlockReduction) is selected, and the fixed point parameter Fixed-point instrumentation mode (MinMaxOverflowLogging) is set to a value other than Force off. Simultaneous use of block reduction and fixed-point instrumentation is not supported for code inspection.Open the Fixed-Point Tool and turn off fixed-point instrumentation for the model.

See Also

Model-Wide Attribute Constraints

Check for usage of synthesized local data stores

Check ID: mathworks.slci.SynthLocalDSM

Check for signal objects in the model workspace that are referenced as synthesized local data stores by Data Store Read or Data Store Write blocks.

Description

This check updates the model diagram and verifies synthesized local data store usage. If the model workspace has signal objects that are referenced as synthesized local data stores by Data Store Read or Data Store Write blocks, Simulink creates a hidden Data Store Memory block at the root level of the model. This model is incompatible with code inspection.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Verify synthesized local data store usageSignal objects are referenced as synthesized local data stores by Data Store Read or Data Store Write blocks. Avoid using signal objects that are referenced as synthesized local data stores by Data Store Read or Data Store Write block. As a possible work around, create graphical Data Store Memory blocks to specify the data stores.

See Also

Model-Wide Attribute Constraints

Check model for compiled and graphical block sorted order

Check ID: mathworks.slci.BlockSortedOrder

Checks that the compiled list of model blocks follow graphical sorted order.

Description

This check updates the model diagram and identifies blocks in the compiled block list of a model that do not match graphical block sorted order.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Check model for compiled and graphical block sorted order Blocks in the compiled block list do not follow graphical sorted order in the model.Contact MathWorks technical support to report this issue.

See Also

Model-Wide Attribute Constraints

Check loop unrolling threshold setting

Check ID: mathworks.slci.RollThreshold

Checks that the model does not have a loop unrolling threshold that might result in partially unrolled loops in the generated code.

Description

This check updates the model diagram and verifies that the model does not have a loop unrolling threshold that might result in partially unrolled loops in the generated code.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Verify loop unrolling threshold settingThe model is configured with aLoop unrolling threshold (Simulink Coder) that might result in partially unrolled loops in the generated code.In the Configuration Parameters dialog box, on the Optimization pane, set the Loop unrolling threshold (Simulink Coder) to the value in the Recommended Action section of the Model Advisor window.

See Also

Model-Wide Attribute Constraints

Check usage of global data stores

Check ID: mathworks.slci.GlobalDSM

Checks that global Data Store Memory blocks use inlined parameters with non-tunable initial values.

Description

This check updates the model diagram and verifies global data store usage. If your model has global Data Store blocks with parameters that are not inlined or have tunable initial values, it is incompatible with code inspection.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Verify global data store usageConfiguration parameter Default parameter behavior (Simulink Coder) (DefaultParameterBehavior) is not set to Inlined.Set Default parameter behavior (Simulink Coder) to Inlined.
Initial value (InitialValue) must not be tunable.Fix the Initial value setting.

See Also

Model-Wide Attribute Constraints

Check global data stores’ name shadow

Check ID: mathworks.slci.GlobalDSMShadow

Checks that global Data Store Memory blocks are not shadowed by local Data Store Memory blocks.

Description

This check updates the model diagram and verifies the name shadow of a global data store. If you have a global Data Store Memory block that is shadowed by a local Data Store Memory block, it is incompatible with code inspection.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Verify global data store’s name shadowGlobal Data Store Memory block is shadowed by a local Data Store Memory block.Remove global Data Store Memory blocks that are shadowed by local Data Store Memory blocks.

See Also

Model-Wide Attribute Constraints

Check destinations of If and Switchcase blocks

Check ID: mathworks.slci.SeparateOutputAndUpdate

Check usage of If and Switch Case blocks connected to Action subsystems that might impact compatibility with Simulink Code Inspector.

Description

This check updates the model diagram and verifies the usage of If and Switch Case blocks connected to Action subsystems.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Check destination Action subsystem of If and Switchcase blocks

Action subsystems connected to the same If or Switch Case blocks do not do one of the following:

  • All combine their output and code updates.

  • All separate their output and code updates.

Modify the listed Action subsystems so that they all combine their output and code updates. Place a Signal Conversion block on signals leaving the inports within the Action subsystems. Select the Signal Conversion block parameter Exclude this block from ‘Block reduction’ optimization to exclude it from block reduction.

See Also

Model-Wide Attribute Constraints

Check for root Outport blocks that have non-auto storage class

Check ID: mathworks.slci.PassReuseOutputArgsAs

Check usage of root outport blocks in referenced model that might impact compatibility with Simulink Code Inspector.

Description

This check updates the model diagram and verifies the usage of root outport blocks in referenced models.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Verify that the storage class of root outports is supportedPass reusable subsystem outputs as: is not set to Structure reference when root outports in referenced models have non-auto storage class.Set Pass reusable subsystem outputs as: to Structure reference.

See Also

Model-Wide Attribute Constraints

Check for Terminator blocks connected to Model Reference block outports

Check ID: mathworks.slci.OutportTerminator

Check usage of terminator blocks connected to model reference blocks that might impact compatibility with Simulink Code Inspector.

Description

This check updates the model diagram and verifies the usage of terminator blocks connected to model reference blocks.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Check for Model Reference block connectivityEvery model reference block outport connects to a terminator block.Consider commenting out the model reference block.

See Also

Model-Wide Attribute Constraints

Check for unsupported propagation of initial condition values

Check ID: mathworks.slci.FirstInitICPropagation

Check if any block propagates initial condition during first time initialization.

Description

This check updates the model diagram and verifies that blocks do not propagate initial condition during first time initialization.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Check for unsupported propagation of initial condition valuesBlock propagates initial condition during first time initialization.Modify the model so that block does not propagate initial condition during first time initialization.

See Also

Model-Wide Attribute Constraints

Check data type replacement names

Check ID: mathworks.slci.DataTypeReplacementName

Check if model uses Simulink.AliasType types for replacement names.

Description

Code inspection is supported for models that use only Simulink.AliasType types for replacement names.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Identify replacement names that are not of type Simulink.AliasTypeIn Data Type Replacement table, the model uses replacement names that are not of type Simulink.AliasType.In the Configuration Parameters dialog box, on the Code Generation > Data Type Replacement pane, set the replacement name to a Simulink.AliasType type.

See Also

Check for multiple sample times in model used as a model reference target

Check ID: mathworks.slci.RefModelMultirate

Description

This check updates the model diagram and verifies that models used as model reference targets do not have multiple sample times.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Check for sample times in model used as model reference targetModel used as model reference target has multiple sample times.Modify the model to have a single sample time.

See Also

Check GetSet storage class for workspace variables

Check ID: mathworks.slci.GetSetVarUsage

Description

This check updates the model diagram and identifies GetSet storage class workspace variables that use unsupported specifications.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Check storage class for workspace variables referenced by the model

For a workspace variable that uses a GetSet custom storage class:

  • The custom storage class does not have a header file defined.

  • The custom storage class data type is a bus or struct.

Modify GetSet storage class workspace variables to use a supported storage class specification.

See Also

Check Treat each discrete rate as a separate task setting

Check ID: mathworks.slci.EnableMultiTasking

Description

This check updates the model diagram and verifies that the Treat each discrete rate as a separate task parameter is selected for a model with multiple discrete rates.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Verify ‘Treat each discrete rate as a separate task’ settingA multirate model is configured for single-tasking execution.In the Configuration Parameters dialog box, on the Solver pane, select Treat each discrete rate as a separate task.

See Also

Simulink Configuration Parameter Constraints

Check model for commented out blocks

Check ID: mathworks.slci.CommentedBlocks

Description

This check updates the model diagram and verifies that the model does not contain commented-out blocks.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Check for commented out blocks in the modelThe model contains a block that is commented out. Modify the model by deleting the commented-out blocks.

See Also

Check model for void_void subsystems that use the same function name

Check ID: mathworks.slci.VVSubSystemName

Description

This check updates the model diagram and verifies that noninlined subsystems with void-void function call interfaces use unique function names.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Check function names used by void_void subsystems in the modelThe model contains void_void subsystems that use the same function name.

Modify void_void subsystems in the model to use unique function names.

See Also

Model-Wide Attribute Constraints

Check n-D Lookup Table blocks for incompatible breakpoint data type

Check ID: mathworks.slci.LookupndBreakpointsDataType

Description

This check updates the model diagram and verifies that the breakpoint data type and the input data type of an n-D Lookup Table block is the same.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Check n-D Lookup Table blocks for incompatible breakpoint data typeBreakpoints > Data Type is not using the same data type as the block input.Modify the data types to match. Or consider setting Breakpoints > Data Type to Inherit: Same as corresponding input.

Check model for reusable subsystems that use the same function interfaces

Check ID: mathworks.slci.ReuseSubSystemLibrary

Description

This check updates the model diagram and verifies that reusable subsystems with the same function interface are from the same library blocks.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Check the model for reusable subsystems with the same function interfaces

There are reusable subsystems with the same function interface, but from different library blocks.

Modify the model so that reusable subsystems with the same function interface come from the same library blocks.

Check for usage of shared synthesized local data stores

Check ID: mathworks.slci.SharedSynthLocalDSM

Description

This check updates the model diagram and verifies that there is no unsupported usage of shared synthesized local data store memories.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Check for usage of shared synthesized local data stores

There are signal objects in the model workspace that are referenced as synthesized local data stores by Data Store Read or Data Store Write blocks in this model.

Avoid using signal objects in the model workspace that are referenced as synthesized local data stores by Data Store Read or Data Store Write blocks. Consider creating graphical Data Store Memory blocks to specify those data stores.

Check usage of Sources blocks

Check ID: mathworks.slci.SourcesBlocksUsage

Check for usage of Sources blocks that might impact compatibility with Simulink Code Inspector.

Description

This check updates the model diagram and reports incompatibilities it finds in Sources blocks.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action

Check Inport blocks

Note

This will check shadowed inports if you have any in your model.

The block cannot specify variable-dimension signals. Block parameter Variable-size signal (VarSizeSig) is set to Yes.Set Variable-size signal to No.
Block parameter Signal Type (SignalType) is set to complex.Set Signal Type to real or auto.
Block parameter Sampling Mode (SamplingMode) is set to Frame based.Set Signal Type to Sample based or auto.
Root inport in referenced model does not connect to a nonvirtual block.Connect root inports in referenced models to at least one nonvirtual block.
For inports in triggered subsystems, Latch input by delaying outside signal (LatchByDelayingOutsideSignal) is selected (set to on).Clear Latch input by delaying outside signal. To retain the latching behavior, restructure the model by placing a Unit Delay block before the input block in the parent diagram.
For root inport blocks that use a bus object, block parameter Output as nonvirtual bus (BusOutputAsStruct) is not selected (set to off).For each instance, select Output as nonvirtual bus.
Inport is an In Bus Element block.Instead of an In Bus Element block, use an Inport block with a Bus Selector block.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Constant blocksBlock parameter Constant value (Value) is empty, is nonfinite, uses range selection or variable indexing on the elements of MATLAB structures, is complex, or has two or more dimensions.Fix the Constant value setting.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Ground blocksBlock port has arrays of buses or buses with elements that are arrays of buses.Fix the listed block port so that the block does not use arrays of buses or buses with elements that are arrays of buses.

Violates a constraint that applies to all blocks:

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.

See Also

Check usage of Signal Routing blocks

Check ID: mathworks.slci.SignalRoutingBlocksUsage

Check for usage of Signal Routing blocks that might impact compatibility with Simulink Code Inspector.

Description

This check updates the model diagram and reports incompatibilities it finds in Signal Routing blocks.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Check Bus Creator blocksThe names of signals in the Bus Creator block (Inputs) do not match the input signal names for the block (InputSignalNames).Modify the listed Bus Creator block to have matching Inputs and InputSignalNames.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Bus Selector blocks

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Bus Assignment blocks

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Data Store Memory blocksBlock parameter Initial value (InitialValue) is empty, is nonfinite, uses range selection or variable indexing on the elements of MATLAB structures, is complex, or has two or more dimensions.Fix the Initial value setting.
Block parameter Signal type (SignalType) is set to complex. Complex values are not supported for code inspection.Set Signal type to auto or real.
Block parameter Detect Write After Write is set to warning or none.Set the block parameter Detect Write After Write to error.

Data Store Memory has arrays of buses or buses with elements that are arrays of buses.

Fix the listed Data Store Memory block.

Violates a constraint that applies to all blocks:

  • Data Store Memory is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the Data Store Memory is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Data Store Memory is complex.

  • Data Store Memory is not a scalar, vector, or 2-D matrix.

  • Data Store Memory uses frame-based signals.

  • Custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Data Store Memory references a signal object with a non-empty initial value.

  • Data Store Memory signal storage class is not set to Auto when the block is constant.

Fix the listed Data Store Memory block.
Check Data Store Read blocksThe block performs discontinuous selection on datastore arrays.Modify the selection to a supported form.
The block uses subscripts with brackets to perform selection on datastore arrays.Modify the datastore array selection in the Data Store Read blocks to not use subscripts with brackets.
Block port has arrays of buses or buses with elements that are arrays of buses.Fix the listed block port so that the block does not use arrays of buses or buses with elements that are arrays of buses.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Data Store Write blocksThe block performs discontinuous selection on datastore arrays.Modify the selection to a supported form.
The block uses subscripts with brackets to perform selection on datastore arrays.Modify the datastore array selection in the Data Store Write blocks to not use subscripts with brackets.
Block port has arrays of buses or buses with elements that are arrays of buses.Fix the listed block port so that the block does not use arrays of buses or buses with elements that are arrays of buses.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check From blocksBlock port has arrays of buses or buses with elements that are arrays of buses.Fix the listed block port so that the block does not use arrays of buses or buses with elements that are arrays of buses.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Goto blocksBlock port has arrays of buses or buses with elements that are arrays of buses.Fix the listed block port so that the block does not use arrays of buses or buses with elements that are arrays of buses.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Merge blocksAllow unequal port widths (AllowUnequalInputPortWidths) is selected.Clear the Allow unequal port widths parameter.
Input port offsets is set to an unsupported value.Set Input port offsets to [].
Source for block must is not an enabled or action subsystem, or is a block with an InitialConditions function.Modify the model so that the sources of merge blocks are either enabled or action subsystems, or blocks without InitialConditions functions.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Switch blocksThe first and third input ports and the output port do not have the same data type.Modify the data ports to have the same data type. Consider selecting the block parameter Require all data port inputs to have the same data type.
Block parameter Integer rounding mode (RndMeth) is set to an unsupported value.Set Integer rounding mode to Zero or Floor.
Block parameter Allow different data input sizes (AllowDiffInputSizes) is selected.Clear the Allow different data input sizes parameter.
Default parameter behavior (DefaultParameterBehavior) is set to Inlined and the source of Inport 2 is constant.Modify the model so that the source of Input 2 is not constant.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Multiport Switch blocksData input and output ports do not have the same data type.Modify the data ports to have the same data type. Consider selecting the block parameter Require all data port inputs to have the same data type.
Data port indices are specified and an input has more than one value.Modify the data port configuration so that only one value is specified per input.
Data port signal is non-contiguous.Modify the data port signal so that it is contiguous.
Data port signal is connected to a block that selects or reorders input signals.Modify the data port signal so that it is not connected to a block that selects or reorders input signals. Consider inserting a Signal Conversion block at the non-contiguous data port.
Block parameter Integer rounding mode (RndMeth) is set to an unsupported value.Set Integer rounding mode to Zero or Floor.
Block parameter Allow different data input sizes (AllowDiffInputSizes) is selected.Clear the Allow different data input sizes parameter.
Default parameter behavior (DefaultParameterBehavior) is set to Inlined and the source of Inport 1 is constant.Modify the model so that the source of Input 1 is not constant.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Mux blocksBlock port has arrays of buses or buses with elements that are arrays of buses.Fix the listed block port so that the block does not use arrays of buses or buses with elements that are arrays of buses.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Demux blocksBlock port has arrays of buses or buses with elements that are arrays of buses.Fix the listed block port so that the block does not use arrays of buses or buses with elements that are arrays of buses.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Selector blocksIndex port is not of a supported data type.Modify index port so that it is of data type int8, int16, int32, uint8, uint16, or uint32.
Index Option (IndexOptionArray) is set to Starting and ending indices (port)Set Index Option to a value other than Starting and ending indices (port).
Number of input dimensions (NumberOfDimensions) is more than 1 and index port data is connected to a block that selects or reorders input.Consider inserting a Signal Conversion block at the index port or modifying the index port data to be contiguous.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Vector Concatenate blocks

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.

See Also

Check usage of Math Operations blocks

Check ID: mathworks.slci.MathOperationsBlocksUsage

Check for usage of Math Operations blocks that might impact compatibility with Simulink Code Inspector.

Description

This check updates the model diagram and reports incompatibilities it finds in Math Operations blocks.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Check Absolute blocksInput or output port is of type int8 or int16.Modify the port to be of data type double, single, uint8, uint16, int32, uint32, or boolean.
Input and output ports do not have the same data type.Modify the port data types to match.
Block parameter Integer rounding mode (RndMeth) is set to an unsupported value.Set Integer rounding mode to Zero or Floor.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Bias blocksInput and output ports do not have the same data type.Modify the port data types to match.
Bias (Bias) is empty, nonfinite, uses range selection or variable indexing on the elements of MATLAB structures, is complex, or has two or more dimensions.Fix the Bias setting.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Gain blocksInput and output ports do not have the same data type.Modify the port data types to match.
Block parameter Gain (Gain) is empty, is nonfinite, uses range selection or variable indexing on the elements of MATLAB structures, is complex, or has two or more dimensions.Fix the Gain setting.
Block parameter Parameter data type (ParamDataTypeStr) does not use the same data type as the Gain block input.Modify the Gain block to use the same data type for its input and parameter. Consider setting Parameter data type to Inherit: Same as input.
Block parameter Multiplication (Multiplication) is not set to Element-wise(K.*u), Matrix(K*u), Matrix(u*K), or Matrix(K*u)(u vector).

Set Multiplication to Element-wise(K.*u), Matrix(K*u), Matrix(u*K), or Matrix(K*u)(u vector).

Only single or double data types are supported for Matrix(K*u), Matrix(u*K), or Matrix(K*u)(u vector) multiplications methods.

Block parameter Integer rounding mode (RndMeth) is set to an unsupported value.Set Integer rounding mode to Zero or Floor.
Block parameter Sample Time (SampleTime) is set to a constant sample time.Set Sample Time to an explicit, non-constant value.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Math blocksInput and output ports do not have the same data type.Modify the port data types to match.
Function (Operator) is set to an unsupported value: conj or hermitian.Set Function to one of the following values: exp, log, 10^u, log10, magnitude^2, square, transposepow, reciprocal, hypot, rem, or mod.
Block parameter Integer rounding mode (RndMeth) is set to an unsupported value.Set Integer rounding mode to Zero or Floor.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Product blocksInput and output ports do not have the same data type.Modify the port data types to match.
Multiplication (Multiplication) is set to Matrix (*) and Saturate on integer overflow (SaturateOnIntegerOverflow) is selected (set to on).Clear the Saturate on integer overflow parameter.

Block parameter Number of inputs (inputs) is not set to 2, **, /*, */, //, or / when both of the following are true:

  • Inport Signal type is a matrix.

  • Product block parameter Multiplication is set to Matrix (*).

Set Number of inputs to 2, **, /*, */, //, or / if both of the following are true:

  • Inport Signal type is a matrix.

  • Product block parameter Multiplication is set to Matrix (*).

Block parameter Multiplication is set to Element-wise(.*) when the inport Signal type is a vector or matrix and the Number of inputs (inputs) is set to 1, * or /.If block parameter Multiplication is set to Element-wise(.*) and the inport Signal type is a vector or matrix, do not set Number of inputs to 1, * or /.
Block parameter Multiplication is set to Element-wise(.*) when the inport Signal type is a scalar and the Number of inputs (inputs) is not set to 1, * or /.If block parameter Multiplication is set to Element-wise(.*) and the inport Signal type is a scalar, then set Number of inputs to 1, * or /.
Block parameter Integer rounding mode (RndMeth) is set to an unsupported value.Set Integer rounding mode to Zero or Floor.
Block parameter Sample Time (SampleTime) is set to a constant sample time.Set Sample Time to an explicit, non-constant value.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Sum blocksInput and output ports do not have the same data type.Modify the port data types to match.
Block parameter Sum over (CollapseMode) is not set to All dimensions.Set Sum over to All dimensions.
Block parameter Accumulator data type (AccumDataTypeStr) does not use the same data type as the block inputsModify the block to use the same data type for its inputs and accumulator. Consider setting Accumulator data type to Inherit: Same as first input.
Block parameter Integer rounding mode (RndMeth) is set to an unsupported value.Set Integer rounding mode to Zero or Floor.
Block parameter Sample Time (SampleTime) is set to a constant sample time.Set Sample Time to an explicit, non-constant value.
Block has one vector input and parameter Saturate on integer overflow (SaturateOnIntegerOverflow) is selected (set to on).Clear the Saturate on integer overflow parameter.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Trigonometry blocksBlock parameter Function (Operator) is set to cos + jsin (complex exponential of the input).Set Function to a value other than cos + jsin.
Block parameter Approximation method (ApproximationMethod) is not set to None.Set Approximation method to None.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check MinMax blocksAn unsupported data type is specified for an input or output port.Modify the port data type to be one of the following: double, single, int8, uint8, int16, uint16, int32, or uint32.
Input and output ports do not have the same data type.Modify the port data types to match.
Block has a single input and the standard math library is not C89/C90 (ANSI).In the Configuration Parameters dialog box, on the Code Generation > Interface pane, set Standard math library to C89/C90 (ANSI).
Block parameter Integer rounding mode (RndMeth) is set to an unsupported value.Set Integer rounding mode to Zero or Floor.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Rounding Function blocks

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double or single.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Reshape blocks

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Sign blocks

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Sqrt blocksBlock inputs and outports do not have the same data type.Fix the listed block inport or outport.
Block parameter Function (Operator) is not set to sqrt or signedSqrt.Set block parameter Function to sqrt or signedSqrt.
Block parameter Output signal type (OutputSignalType) is set to complex.Set block parameter Output signal type (OutputSignalType) to auto or real.
Block input and block parameter Intermediate results (IntermediateResultsDataTypeStr) do not have the same data type.

Set block parameter Intermediate results (IntermediateResultsDataTypeStr) to one of the following:

  • Same data type as block input

  • Inherit: Inherit via internal rule

  • Inherit: Inherit from input

  • Inherit: Inherit from output

Block inputs and outports data types are not single or double.Fix the listed block inport or outport.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Assignment blocksIndex port is not of a supported data type.Modify index port so that it is of data type int8, int16, int32, uint8, uint16, or uint32.

Initialize output (Y) (OutputInitialize) must be set to Initialize using input port <Y0>.

Set Initialize output (Y) to Initialize using input port <Y0>.

Block port has arrays of buses or buses with elements that are arrays of buses.Fix the listed block port so that the block does not use arrays of buses or buses with elements that are arrays of buses.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Polynomial blocksInput and output ports do not have the same data type.Modify the port data types to match.
Input port data types are not single or double.Modify the listed input port data types.
Number of coefficients for block parameter Polynomial Coefficients (coefs) is not greater than zero. Modify the number of coefficients for block parameter Polynomial Coefficients (coefs) to be greater than zero.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Dot Product blocksInput ports are not scalars, vectors, or single-column matrices.Modify the listed input ports.
Input port data types are not single or double.Modify the listed input port data types.
Input and output ports do not have the same data type. Modify the port data types to match.
Block parameter Integer rounding mode (RndMeth) is set to an unsupported value.Set Integer rounding mode to Zero or Floor.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Unary Minus blocksInput port data types are not double, single, int8, int16, or int32.Modify the listed input port data types.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.

See Also

Check usage of Signal Attributes blocks

Check ID: mathworks.slci.SignalAttributesBlocksUsage

Check for usage of Signal Attributes blocks that might impact compatibility with Simulink Code Inspector.

Description

This check updates the model diagram and reports incompatibilities it finds in Signal Attributes blocks.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Check Data Type Conversion blocksBlock parameter Input and output to have equal (ConvertRealWorld) is not set to Real World Value (RWV).Set Input and output to have equal to Real World Value (RWV).
Block parameter Integer rounding mode (RndMeth) is set to an unsupported value.Set Integer rounding mode to Zero or Floor.
Block parameter Sample Time (SampleTime) is set to a constant sample time.Set Sample Time to an explicit, non-constant value.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Data Type Duplicate blocks

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Data Type Propagation blocks
  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix.

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Signal Specification blocksVariable-size signal (VarSizeSig) is not set to No.Set Variable-size signal to No.
Signal type (SignalType) is set to complex.Set Signal type to any type except complex.
Sampling mode (SamplingMode) is set to Frame based. Set Sampling mode to any mode except Frame based.
Block port has arrays of buses or buses with elements that are arrays of buses.Fix the listed block port so that the block does not use arrays of buses or buses with elements that are arrays of buses.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Signal Conversion blocksBlock parameter Output (ConversionOutput) is not set to Signal copy.Set Output to Signal copy.
Block parameter Exclude this block from 'Block reduction' optimization (OverrideOpt) is not selected (set to on).Select Exclude this block from 'Block reduction' optimization.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Rate Transition blocksBlock parameter Ensure data integrity during data transfer (Integrity) is not selected.Select Ensure data integrity during data transfer.
Block parameter Ensure deterministic data transfer (maximum delay) (Deterministic) is not selected.Select Ensure deterministic data transfer (maximum delay).
Block parameter Initial conditions (InitialCondition) is not zero, non-zero scalar or does not use the same data structure as the output data type.Modify the block parameter to be zero, non-zero scalar, or to use the same data structure as the output data type.
Block parameter Initial conditions (InitialCondition) is empty, nonfinite, complex, uses range selection or variable indexing on the elements of MATLAB structures, or has two or more dimensions.Modify the block parameter so that is not empty, is not nonfinite, is not complex, does not use range selection or variable indexing on the elements of MATLAB structures, and does not have two or more dimensions.
Block port has arrays of buses or buses with elements that are arrays of buses.Fix the listed block port so that the block does not use arrays of buses or buses with elements that are arrays of buses.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Probe blocksBlock parameter Data type for sample time (ProbeSampleTimeDataType) is not set to single or double.Set block parameter Data type for sample time to single or double.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Width blocksBlock port has arrays of buses or buses with elements that are arrays of buses.Fix the listed block port so that the block does not use arrays of buses or buses with elements that are arrays of buses.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Unit Conversion blocksInput port data type is not double or single. Modify the input port data type.
Input and output ports do not have the same data type.Modify the port data types to match.
Block does not use supported inport or outport units.

Modify the block to use supported inport and outport units. Conversions between the following are included:

  • deg and rad

  • degC and degF

  • degC and degR

  • degR and degF

  • degC and K

  • degF and K

  • degR and K

  • deltadegC and deltadegF

  • deltadegC and deltadegR

  • deltadegR and deltadegF

  • deltadegC and deltaK

  • deltadegF and deltaK

  • deltadegR and deltaK

  • ft and m

  • ft and mi

  • M and ft

  • M and m

  • kg and lbm

  • lbf and N

  • inHg and Pa

  • mmHg and inHg

  • mph and kn

  • mph and fps

  • fps and kn

  • percent and one

  • kn and nmi/s

  • ms and s

  • psf and psi

  • lbf/hr and lbf/sec

  • lbm/hr and lbm/sec

  • kip and N

  • kip and lbf

  • fpm (input unit) and fps (output unit)

  • hr (input unit) and min (output unit)

  • min (input unit) and s (output unit)

  • ft*lbf/slug/degR (input unit) and ft*lbf/slug/K (output unit)

  • fps (input unit) and fpm (output unit)

  • min (input unit) and hr (output unit)

  • ft*lb/slug/degR (input unit) and ft*lb/slug/K (output unit)

  • slug (input unit) and lbm (output unit)

  • lbm (input unit) and slug (output unit)

  • s (input unit) and hr (output unit)

  • ft/min (input unit) and kn (output unit)

  • kn (input unit) and ft/min (output unit)

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check IC blocksBlock parameter Initial value (Value) is empty, nonfinite, complex, uses range selection or variable indexing on the elements of MATLAB structures, or has two or more dimensions.Modify the block parameter so that is not empty, is not nonfinite, is not complex, does not use range selection or variable indexing on the elements of MATLAB structures, and does not have two or more dimensions.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.

See Also

Check usage of Logical and Bit Operations blocks

Check ID: mathworks.slci.LogicalandBitOperationsBlocksUsage

Check for usage of Logical and Bit Operations blocks that might impact compatibility with Simulink Code Inspector.

Description

This check updates the model diagram and reports incompatibilities it finds in Logical and Bit Operations blocks.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Check Relational Operator blocksThe data type of a block outport is not either an enumerated type with default value 0, or boolean.Modify the outport data type to be either an enumerated type with default value 0, or boolean.
Block input ports do not have the same data type.Modify the input ports to have the same data type.
Block parameter Relational operator (Operator) is set to an unsupported value: isInf, isNaN, or isFinite.Set Relational operator to a supported value: <=, ==, >=, ~=, <, or >.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Logical Operator blocksLogical Operator block outport is not boolean or uint8.Modify the data type of the outport to boolean or uint8.
Block input ports do not have the same data type.Configure the input ports to have the same data type.
Model parameter Casting modes is not set to Nominal for XOR operators with boolean operands.Set model parameter Casting modes to Nominal.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Bitwise Operator blocksWith Number of input ports(NumInputPorts) set to 1 and Operator(logicop) set to AND, OR, NAND, NOR, or XOR, the inport data type is not a scalar.Configure the inport data type to be a scalar.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check ArithShift blocksDiagnostic for out of range shift value (DiagnosticForOORShift) is not set to Error.Set Diagnostic for out of range shift value to Error.
Binary points to shift (BinPtShiftNumber) is not set to 0.Set Bits points to shift to 0.
Bits to shift: Number (BitShiftNumber) is not within the allowable range of the inport data type.Enter a Bits to shift: Number that is within the allowable range of the inport data type.

The following configuration parameters are set as follows:

  • Default parameter behavior (DefaultParameterBehavior) is set to Inlined

  • Bits to shift: Source (BitShiftNumberSource) is set to Input port

  • Bits to shift: Direction (BitShiftDirection) is set to Bidirectional

when the source of Inport 2 is constant.

Modify the model so that the source of Input 2 is not constant.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Combinatorial Logic blocks

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.

See Also

Check usage of Lookup Tables blocks

Check ID: mathworks.slci.LookupTablesBlocksUsage

Check for usage of Lookup Table blocks that might impact compatibility with Simulink Code Inspector.

Description

This check updates the model diagram and reports incompatibilities it finds in Lookup Table blocks.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Check Lookup Table blocksInput and output ports do not have the same data type.Modify the input and output ports to have the same data type.
Block parameter Breakpoints specification (BreakpointsSpecification) is not set to Explicit values.Set Breakpoints specification to Explicit values.
Block parameter Interpolation method (InterpMethod) is not set to Linear point-slope.Set Interpolation method to Linear point-slope.
Block parameter Extrapolation method (ExtrapMethod) is not set to Clip or Linear.Set Extrapolation method to Clip or Linear.
Block parameter Index search method (IndexSearchMethod) is not set to Binary search or Linear search.Set Index search method to Binary search or Linear search.
Block parameter Support tunable table size in code generation (SupportTunableTableSize) is selected (set to on).Clear the Support tunable table size in code generation parameter.
Block parameter Table data (Table) is empty, is nonfinite, uses range selection or variable indexing on the elements of MATLAB structures, is complex, or has two or more dimensions.Fix the Table data setting.
For Breakpoints specification (BreakpointsSpecification) set to Explicit values, a Breakpoints block parameter is empty, is nonfinite, uses range selection or variable indexing on the elements of MATLAB structures, is complex, or has two or more dimensions.Fix the Breakpoints 1 setting.
Breakpoints > Data Type is not using the same data type as the block input.Modify the data types to match. Or consider setting Breakpoints > Data Type to Inherit: Same as corresponding input
Block parameter Table data (TableDataTypeStr) is not using the same data type as the block output.Modify the data types to match.
Block parameter Intermediate Results (IntermediateResultsDataTypeStr) is not using the same data type as the block output.Modify the data types to match.
Block or block output port is constant.Set the sample time of the block or block output port to an explicit, non-constant sample time.
Block parameter Use one input port for all input data (UseOneInputPortForAllInputData) is selected.Clear Use one input port for all input data.
A Lookup Table block uses a lookup table object with the Support tunable size property selected.Clear the Support tunable size property.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Prelookup blocksBlock parameter Index search method (IndexSearchMethod) is not set to Binary search or Linear search.Set Index search method to Binary search or Linear search.
Block parameter Breakpoints specification (BreakpointsSpecification) is not set to Explicit values.Set Breakpoints specification to Explicit values.
Block parameter Output selection is not set to Index and fraction.Set Output selection to Index and fraction.
Block parameter Breakpoint > Data Type is not set to Inherit: Same as input, single, or double.Set Breakpoint > Data Type to Inherit: Same as input, single, or double.
Block parameter Index > Data Type (IndexDataTypeStr) is not set to uint32.Set Index > Data Type to uint32.
Block parameter Fraction > Data Type (FractionDataTypeStr) is not set to single or double.Set Fraction > Data Type to single or double.
Block parameter Integer rounding mode (RndMeth) is set to an unsupported value.Set Integer rounding mode to Floor.
Block parameter Use last breakpoint for input at or above upper limit (UseLastBreakpoint) is selected.Clear the Use last breakpoint for input at or above upper limit parameter.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Interpolation Using Prelookup blocksIntermediate results > Data Type (IntermediateResultsDataTypeStr) is not set to Inherit:Inherit via internal rule , Inherit: Same as output, double, or single.Set Intermediate results > Data Type to Inherit:Inherit via internal rule , Inherit: Same as output, double, or single.
Output > Data Type (OutDataTypeStr) is not set to Inherit:Inherit via back propagation , Inherit: Inherit from ‘Table data’, double, or single.Set Output > Data Type to Inherit:Inherit via back propagation , Inherit: Inherit from ‘Table data’, double, or single.
Table data > Data Type (TableDataTypeStr) is not set to Inherit: Inherit from ‘Table data’, Inherit: Same as output, double, or single.Set Table data > Data Type to Inherit: Inherit from ‘Table data’, Inherit: Same as output, double, or single.
Internal Rule Priority (InternalRulePriority) is not set to Precision.Set Internal Rule Priority to Precision.
Number of sub-table selection dimensions or the index value (k) from Prelookup block is not of data type uint32.Set Number of sub-table selection dimensions and the index value to be of data type uint32.
Intermediate results > Data Type (IntermediateResultsDataTypeStr), Table data > Data Type (TableDataTypeStr), Output > Data Type (OutDataTypeStr), and the fraction value (f) from Prelookup block are not the same data type: double or single.Set Intermediate results > Data Type, Table data > Data Type, Output > Data Type , and the fraction value to be the same data type: double or single.
Integer rounding mode (RndMeth) is not set to Floor.Set Integer rounding mode to Floor.
Saturate on integer overflow (SaturateOnIntegerOverflow) is selected (set to on).Clear Saturate on integer overflow.
Block is constant or connects all subtable selection inports to constant blocks.Modify the blocks so that they are not constant and do not connect all subtable selection inports to constant blocks.
Blocks or their outports have a constant sample time.Set sample times of the blocs or block output ports to explicit non-constant sample times.
Block parameter Interpolation method (InterpMethod) is not set to Linear point-slope.Set Interpolation method to Linear point-slope.
Block parameter Require index and fraction as bus (RequireIndexFractionAsBus) is selected (set to on).Clear Require index and fraction as bus.
Block parameter Valid index input may reach last index (ValidIndexMayReachLast) is selected (set to on).Clear Valid index input may reach last index.
Block parameter Specification (TableSpecification) is not set to Explicit values.Set Specification to Explicit values.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix.

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.

See Also

Check usage of User-Defined Function blocks

Check ID: mathworks.slci.UserDefinedFunctionBlocksUsage

Check for usage of User-Defined Function blocks that might impact compatibility with Simulink Code Inspector.

Description

This check updates the model diagram and reports incompatibilities it finds in User-Defined Function blocks.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Check S-Function blocksThe S-function was not created using the current release of the Legacy Code Tool.If possible, create the S-function using the Legacy Code Tool, or explore alternatives for including the code in the model.
An S-function argument is neither a scalar nor a vector of fixed dimension.Modify the S-function such that arguments are scalars or vectors of fixed dimension.
The Legacy Code Tool S-function specifies a InitializeConditionsFcnSpec, StartFcnSpec, or TerminateFcnSpec, rather than an OutputFcnSpec.Modify the S-function configuration to specify an OutputFcnSpec.
The S-function has more than one dwork.Modify the S-function configuration to specify one dwork.
S-function parameters (Parameters) is complex or non-finite.Modify the model so that S-function parameters is not complex or non-finite.
The integrated model of an S-function SIL block uses a global variable for a root input or output port.Modify the model so that it does not use global variables for root input or output ports.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.

See Also

Check usage of Ports and Subsystems blocks

Check ID: mathworks.slci.PortsandSubsystemsBlocksUsage

Check for usage of Ports and Subsystems blocks that might impact compatibility with Simulink Code Inspector.

Description

This check updates the model diagram and reports incompatibilities it finds in Ports and Subsystems blocks.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Check Enable blocksThe signal entering the enable port is not of data type boolean.Fix the signal data type.
The Enable Port block is located at the root level of the model.Remove or relocate the Enable Port block.
Default parameter behavior (DefaultParameterBehavior) is set to Inlined and the signal entering the Enable Port of the parent subsystem is constant.Modify the model so that the signal entering the Enable Port of the parent subsystem is not constant.
Block port has arrays of buses or buses with elements that are arrays of buses.Fix the listed block port so that the block does not use arrays of buses or buses with elements that are arrays of buses.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Model Reference blocksValue that is specified in Arguments > Model arguments (ParameterArgumentValues) is complex or nonfinite.Modify the model so that values specified in Model arguments are not complex or nonfinite.
Block is in protected mode.Remove protection from the model reference. For more information, see Protect Models to Conceal Contents (Simulink Coder).
Block or block output port is constant.Set the sample time of the block or block output port to an explicit, non-constant sample time.
Block has multiple sample times.Modify the model reference target so that the Model Reference block has a single sample time.

Block input port is not one of the following supported data types:

  • An enumerated type inherited from Simulink.IntEnumType with default value 0.

  • Scalar bus whose elements are among the following supported data types: double, single, int8, uint8, int16, uint16, int32, uint32, or boolean.

Fix the input port data type.
For input ports within a triggered model reference block, Latch input by delaying outside signal (LatchByDelayingOutsideSignal) is selected (set to on).Clear Latch input by delaying outside signal. To retain the latching behavior, restructure the model by placing a Unit Delay block before the input block, outside the model reference block.
For input ports of a model reference block, Latch input for feedback signals of function-call subsystem outputs (LatchInputForFeedbackSignals) is selected (set to on).Clear Latch input for feedback signals of function-call subsystem outputs. To retain the latching behavior, restructure the model by placing a Unit Delay block before the input block, outside the model reference block.
Model blocks use the instance parameters of referenced models as arguments.Modify the model so that the Model blocks do not use the instance parameters of referenced models as arguments.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Subsystem blocksSubsystem variants do not have the same number of ports.

If possible, reconfigure the model so that variant subsystems have the same number of ports.

The subsystem is not one of the following:

  • Virtual

  • Enabled

  • Function-Call

  • If Action

  • Inlined Atomic

  • Triggered

If possible, reconfigure the subsystem to be either virtual (clear the Subsystem block parameter Treat as atomic unit), or an inlined atomic, enabled, function-call, if action, or triggered subsystem. Alternatively, wrap the subsystem in a Model block, or explore other implementation options.

Subsystem is a Simulink Function block.

Modify the model to remove the Simulink Function blocks.

For blocks with variants, either of these conditions apply:

  • Generate preprocessor conditionals (GeneratePreprocessorConditionals) is selected.

  • Model Configuration Parameters > Code Generation > Interface > Generate preprocessor conditionals (GeneratePreprocessorConditionals) is not set to Disable all.

Clear Generate preprocessor conditionals or set Model Configuration Parameters > Code Generation > Interface > Generate preprocessor conditionals to Disable all.

Block parameter Minimize algebraic loop occurrences (MinAlgLoopOccurences) is selected.

Clear Minimize algebraic loop occurrences.

For nonvirtual subsystems, Function packaging (RTWSystemCode) is not set to Inline, Nonreusable function, or Reusable function.

Set Function packaging to Inline, Nonreusable function, or Reusable function.

For block with Function packaging (RTWSystemCode) set to Nonreusable function, one or more of the following conditions apply:

  • Block parameter Function name options (RTWFcnNameOpts) is not set to User specified.

  • Block parameter Function interface (FunctionInterfaceSpec) is not set to void_void.

  • Block parameter Function with separate data (FunctionWithSeparateData) is selected (is set to on).

  • Model parameter Code interface packaging (CodeInterfacePackaging) is not set to Nonreusable function.

Fix the block and model parameters.

For block with Function packaging (RTWSystemCode) set to Reusable function, one or more of the following conditions apply:

  • Model parameter Code interface packaging (CodeInterfacePackaging) is not set to Nonreusable function.

  • Model parameter Pass reusable subsystem outputs as (PassReuseOutputArgsAs) is not set to Individual arguments

  • Reusable subsystem is not from a library.

  • Reusable subsystem is not an unmasked single-rate atomic or function-call subsystem.

  • Fix the block and model parameters.

  • Modify reusable subsystems so that they are from a library and are unmasked, single-rate atomic or function-call subsystems.

Block port has arrays of buses or buses with elements that are arrays of buses.Modify the model so that the Model blocks do not use the instance parameters of referenced models as arguments.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
In the reusable subsystem, a hidden signal buffer has been automatically added at its inport.Manually place a Signal Conversion block just before the inport of reusable subsystem. Select the signal conversion block parameter Exclude this block from 'Block reduction' optimization.
Check Trigger blocksIn the parent subsystem, the signal entering the trigger port is not a scalar.Configure the signal entering the trigger port of the parent subsystem to be scalar.
In the parent subsystem, the signal entering the trigger port is not a boolean data type when Trigger type (TriggerType) isrising, falling, or either.Configure the signal entering the trigger port of the parent subsystem to be boolean.
Block is at the root level of the model with Trigger type (TriggerType) set to rising, falling, or either.

Do one of the following:

  • Configure the model so that the Trigger block is not at the root of the model.

  • Configure the model so that Trigger type is function-call.

States when enabling (StatesWhenEnabling) is set to inherit.Set States when enabling to held or reset.
Default parameter behavior (DefaultParameterBehavior) is set to Inlined and the signal entering the Trigger Port of the parent subsystem is constant.Modify the model so that the signal entering the Trigger Port of the parent subsystem is not constant.
Output ports data type is not auto, int8 or double.Fix the output port data type.
Block parameter Initial trigger signal state (InitialTriggerSignalState) is not set to compatibility (no trigger on first evaluation) or zero.Set Initial trigger signal state to compatibility (no trigger on first evaluation) or zero.
Block port has arrays of buses or buses with elements that are arrays of buses.Modify the model so that the Model blocks do not use the instance parameters of referenced models as arguments.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport
Check Action Port blocks

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check If blocksDefault parameter behavior (DefaultParameterBehavior) is set to Inlined and the source of Inport 1 is constant.Modify the model so that the source of Input 1 is not constant.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Function-Call Generator blocksBlock has more than one destination.Modify the model so that the block has one destination.
The Number of iterations (numberOfIterations) is not set to 1.Set the Number of iterations to 1.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Function-Call Split blocks

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Switch Case blocksDefault parameter behavior (DefaultParameterBehavior) is set to Inlined, and the source of Inport 1 is constant.Modify the model so that the source of Input 1 is not constant.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check For Iterator blocksBlock parameter Set next i (iteration variable) externally (ExternalIncrement) is selected (set to on).Clear Set next i (iteration variable) externally.
Iteration limit source (IterationSource) is not set to internal.Set Iteration limit source to internal.
Iteration variable data type (IterationVariableDataType) is set to double.Set Iteration variable data type to int32, int16, or int8.
For Iterator subsystem has a tunable parameter for internal iteration limit.Set Default parameter behavior (DefaultParameterBehavior) to Inlined or modify the internal iteration limit so that it is not a tunable parameter.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check For Each blocksInput Partition Dimension or Output Concatenation Dimension is greater than 2.Set Input Partition Dimension and Output Concatenation Dimension to values less than 3.
Mask parameters are partitioned.Configure mask parameters so that they are not partitioned.
NeedActiveIterationSignal is set to on.Set NeedActiveIterationSignal to off.
RequestParallelExec is set to off.Set RequestParallelExec to on.
ShowIterationIndex is set to on.Set ShowIterationIndex to off.
StateReset is not set to held.Set StateReset to held.
StateType is not set to Separate states for each iteration.Set StateType to Separate states for each iteration.
Number of iterations to execute is not set to -1 (default value).Set the Number of iterations to execute to the default value -1.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.

See Also

Check usage of Discontinuities blocks

Check ID: mathworks.slci.DiscontinuitiesBlocksUsage

Check for usage of Discontinuities blocks that might impact compatibility with Simulink Code Inspector.

Description

This check updates the model diagram and reports incompatibilities it finds in Discontinuities blocks.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Check Saturate blocksInput and output ports do not have the same data type.Modify the port data types to match.
Block parameter Upper limit (UpperLimit) is empty, is nonfinite, uses range selection or variable indexing on the elements of MATLAB structures, is complex, or has two or more dimensions.Fix the Upper limit setting.
Block parameter Lower limit (LowerLimit) is empty, is nonfinite, uses range selection or variable indexing on the elements of MATLAB structures, is complex, or has two or more dimensions.Fix the Lower limit setting.
Block parameter Integer rounding mode (RndMeth) is set to an unsupported value.Set Integer rounding mode to Zero or Floor.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Relay blocksBlock parameter Switch on point (OnSwitchValue) is empty, is nonfinite, uses range selection or variable indexing on the elements of MATLAB structures, is complex, or has two or more dimensions.Fix the Switch on point setting.
Block parameter Switch off point (OffSwitchValue) is empty, is nonfinite, uses range selection or variable indexing on the elements of MATLAB structures, is complex, or has two or more dimensions.Fix the Switch off point setting.
Block parameter Output when on (OnOutputValue) is empty, is nonfinite, uses range selection or variable indexing on the elements of MATLAB structures, is complex, or has two or more dimensions.Fix the Output when on setting.
Block parameter Output when off (OffOutputValue) is empty, is nonfinite, uses range selection or variable indexing on the elements of MATLAB structures, is complex, or has two or more dimensions.Fix the Output when off setting.
Check Dead Zone blocksBlock parameter Saturate on integer overflow (SaturateOnIntegerOverflow) is selected (set to on).Fix the Saturate on integer overflow setting.

See Also

Check usage of Sinks blocks

Check ID: mathworks.slci.SinksBlocksUsage

Check for usage of Sinks blocks that might impact compatibility with Simulink Code Inspector.

Description

This check updates the model diagram and reports incompatibilities it finds in Sinks blocks.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Check Outport blocksThe block cannot specify variable-dimension signals. Block parameter Variable-size signal (VarSizeSig) is set to Yes.Set Variable-size signal to No.
Signal type (SignalType) is set to complex.Set Signal type to real or auto.
Sampling mode (SamplingMode) is set to Frame based.Set Sampling mode to Sample based or auto.
Root level outport Initial output (InitialOutput) is not [].Set root level outport Initial output to [].
Source of initial output value (SourceOfInitialOutputValue) is not set to Dialog.Set Source of initial output value to Dialog.
Initial output (InitialOutput) is complex.Modify the model so that Initial output is not complex.
Storage Class (StorageClass) is not Auto.In the Code Mappings editor, set Storage Class to Auto. To open the Code Mappings editor, first open the Embedded Coder app. Then on the C Code tab, under Code Interface select Individual Elements Code Mappings.
Outport is an Out Bus Element block.Instead of an Out Bus Element block, use an Outport block with a Bus Creator block.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Terminator blocksBlock port has arrays of buses or buses with elements that are arrays of buses.Fix the listed block port so that the block does not use arrays of buses or buses with elements that are arrays of buses.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.

See Also

Check usage of Discrete blocks

Check ID: mathworks.slci.DiscreteBlocksUsage

Check for usage of Discrete blocks that might impact compatibility with Simulink Code Inspector.

Description

This check updates the model diagram and reports incompatibilities it finds in Discrete blocks.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Check Unit Delay blocksBlock parameter Initial conditions (InitialCondition) is empty, is nonfinite, uses range selection or variable indexing on the elements of MATLAB structures, is complex, or has two or more dimensions.Fix the Initial conditions setting.
Block parameter Input Processing (InputProcessing) is set to Columns as channels (frame based).Set Input Processing to Elements as channels (sample based) or Inherited.

When block state resolves to a signal with a custom signal storage class, the signal storage class:

  • Type is not set to Unstructured.

  • Data initialization is set to None.

Modify the custom signal storage class.
Block state resolves to a signal object with a non-empty initial value.Modify the signal object.
Block is used for rate transition.Replace block used for rate transition with a Rate Transition block.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Discrete Integrator blocksInput ports data types are not single or double for non-reset ports.Modify the input ports data types to be single or double for non-reset ports.
Inports and outports are not scalars.Modify the inport or outports to be scalars.
Output ports data types are not single or double.Modify the output ports data types to be single or double.
The input and output ports do not have the same data type.Modify the port data types to match. The reset port data type does not need to match the other input and output data types.

Block parameter Integrator method (IntegratorMethod) is not set to one of the following:

  • Integration: Forward Euler

  • Integration: Backward Euler

  • Integration: Trapezoidal

Set Integrator method to one of the following:

  • Integration: Forward Euler

  • Integration: Backward Euler

  • Integration: Trapezoidal

Block parameter Show state port (ShowStatePort) is selected.Clear Show state port.
Block parameter External reset (ExternalReset) is not set to none. Set block parameter External reset to none.

Either or both block parameters Upper saturation limit (UpperSaturationLimit) and Lower saturation limit (LowerSaturationLimit):

  • Are empty, non-finite, or complex.

  • Uses range selection or variable indexing on the elements of MATLAB structures

  • Have two or more dimensions.

Set both the Upper saturation limit and the Lower saturation limit to a one-dimensional, non-complex, finite value.
Block is inside a conditional subsystem.Modify the model so that the Discrete Integrator block is not inside a conditional subsystem.
Default parameter behavior (DefaultParameterBehavior) is set to Inlined) and the source of block Inport 2 is constant.Set the sample times of the blocks to explicit, non-constant sample times. Modify the model so that the source of block Input 2 is not constant.

When block state resolves to a signal with a custom signal storage class, the signal storage class:

  • Type is not set to Unstructured.

  • Data initialization is set to None.

Modify the custom storage class.
Block state resolves to a signal object with a non-empty initial value.Modify the signal object.

Violates a constraint that applies to all blocks:

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.
Check Delay blocksBlock parameter Input processing (InputProcessing) is set to Columns as channels (frame based).Set Input processing to something other than Columns as channels (frame based).
Block parameter Show enable port (ShowEnablePort) is selected.Clear Show enable port.

Violates a constraint that applies to all blocks:

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

 

See Also

Check usage of Stateflow blocks

Check ID: mathworks.slci.StateflowBlocksUsage

Check for usage of Stateflow blocks that might impact compatibility with Simulink Code Inspector.

Description

This check updates the model diagram and reports incompatibilities it finds in Stateflow blocks.

Available with Simulink Code Inspector.

Results and Recommended Actions

CheckConditionRecommended Action
Check Stateflow blocksFunction packaging (RTWSystemCode) is not set to Inline.Set Function packaging to Inline, Nonreusable function or Reusable function. If you select Nonreusable function, the subsystem must be in the following configurations:
  • Set Function name options to User Specified.

  • Set Function interface to void-void.

  • Set Function with separate data to off.

  • Set model parameter Code interface packaging to Nonreusable function.

If you select Reusable function, the model must use the following configurations:
  • Pass reusable subsystem outputs as to Individual arguments

  • Set model parameter Code interface packaging to Nonreusable function.

Reusable subsystems in the model are not from a library and are not unmasked single-rate atomic or function-call subsystems.Modify the reusable subsystems in the model so that they are from a library and unmasked single-rate atomic or function-call subsystems.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses, the block port is not a bus for which the elements (potentially including other buses) meet the data type constraint.

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.

See Also

Check usage of String blocks

Check ID: mathworks.slci.StringBlocksUsage

Identify usage of String blocks that might impact compatibility with Simulink Code Inspector.

Description

This check updates the model diagram and reports incompatibilities it finds in String blocks.

Results and Recommended Actions

SubcheckConditionRecommended Action
Check ASCII to String blocksThe dimension of the input is greater than or equal to the value of the parameter Buffer size of dynamically-sized string (bytes) (Simulink Coder).Fix the input dimension.

Violates a constraint that applies to all blocks:

  • Block inport or outport is not of data type double, single, int8, uint8, int16, uint16, int32, uint32, boolean, or enumeration inherited from Simulink.IntEnumType with default value 0.

  • If the block supports buses:

  • Block name contains ‘*/’ or ‘/*’, or ends with ‘*’.

  • Block inport or outport is complex.

  • Block inport or outport is not a scalar, vector, or 2-D matrix. The condition excludes these blocks:

    • Reshape

    • Selector

    • Concatenate

    • Interpolation Using Prelookup (n-D)

    • n-D Lookup Table

  • Block inport or outport uses frame-based signals.

  • Block output custom signal storage class:

    • Type is not set to Unstructured.

    • Data initialization is set to None.

  • Block output port references a signal object with a non-empty initial value.

  • Block is constant and an outport is testpointed.

  • Block output signal storage class is not set to Auto when the block is constant.

  • Block that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.

Fix the listed block inport or outport.

See Also

Supported Block Constraints

Check usage of Stateflow charts

Check ID: mathworks.slci.chartsSFObjsUsage

Check for usage of Stateflow charts that might impact compatibility with Simulink Code Inspector.

Description

This check updates the model diagram and reports incompatibilities it finds in Stateflow charts.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Check usage of Stateflow object palette

The chart contains one or more of the following objects:

  • Atomic Subcharts

  • Atomic Boxes

  • MATLAB functions

  • Simulink based states

Configure the chart so that it does not contain the unsupported objects.
Check name usage in a Stateflow chart that uses MATLAB action languageA chart that uses MATLAB action language does not have unique names for the Simulink functions, graphical functions, and truth tables it contains.Use unique names for the functions, graphical functions, and truth tables in the chart.
Check that all charts unselect ‘Create data for monitoring child activity’ optionChart property Create data for monitoring child activity is selected (set to on).Clear the chart property Create data for monitoring child activity parameter.
Check that all charts specify 'Inherited' as their update method Chart property Update method is not set to Inherited.Set Update method to Inherited.
Check that states or substates have a default transitionChart has a state or a substate without a default transition.Configure the chart so that states and substates have default transitions.
Check that all charts unselect ‘Enable Super Step Semantics’ optionChart property Enable Super Step Semantics is selected (set to on).Clear the chart property Enable Super Step Semantics parameter.
Check that no charts execute at initializationChart property Execute (enter) Chart at Initialization is selected (set to on).Clear the chart property Execute (enter) Chart at Initialization parameter.
Check that no charts export chart level functionsChart property Export Chart Level Functions is selected (set to on).Clear the chart property Export Chart Level Functions parameter.
Check that no charts specify saturation on overflow for integer operationsChart property Saturate on integer overflow is selected (set to on).Clear the chart property Saturate on integer overflow parameter.
Check usage of State Machine TypeChart property State Machine Type is set to Moore.Set State Machine Type to Classic or Mealy.
Check that no charts support variable-size arraysChart property Support variable-size arrays is selected (set to on).Clear the chart property Support variable-size arrays parameter.
Check that all control flows have unique default transitions Control flow has more than 1 default transition.Configure the chart so that it has 1 default transition.

See Also

Check usage of Stateflow MATLAB action language

Check ID: mathworks.slci.MATLABactionlanguageStateflowUsage

Check for usage of Stateflow MATLAB action language that might impact compatibility with Simulink Code Inspector.

Description

This check updates the model diagram and reports incompatibilities it finds in Stateflow MATLAB action language usage.

Available with Simulink Code Inspector.

Results and Recommended Actions

For subchecks run to check the usage of MATLAB action language in Stateflow charts, see Check usage of Code in MATLAB Functions.

See Also

Check usage of Stateflow transitions

Check ID: mathworks.slci.transitionsSFObjsUsage

Check for usage of Stateflow transitions that might impact compatibility with Simulink Code Inspector.

Description

This check updates the model diagram and reports incompatibilities it finds in Stateflow transitions.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Check that actions do not have unsupported operations

Action uses an operation that is not supported:

  • := or =

  • + , += , -, or -=

  • * , *=, / or /=

  • &, && or &=

  • |, || or |=

  • << or >>

  • cast()

  • ^ or ^=

  • %% or <

  • <= or ==

  • ~= or !=

  • <> or >

  • >= or ~

Modify the chart so that action uses only supported operations.
Check for indexing in arrays that are more than one dimensionArray of more than one dimension uses indexing.Modify the transition to use one-dimensional arrays or avoid indexing for arrays that are more than one dimension.
Check that all arrays use index of type 'int32' Array does not use index of data type int32.Modify the array index so that it uses data type int32.
Check that all transition conditions are of boolean data typeTransition condition is not of boolean data type.Modify the transition condition so that it is of boolean data type.
Check that no actions access context-sensitive constants Action uses context-sensitive constants, which is not supported for code inspection.Modify the action to avoid using context-sensitive constants.
Check that no actions access custom data Action accesses custom data, which is not supported for code inspection.

Modify the transitions to:

  • Use qualified enumerations.

  • Avoid accessing custom data.

Check that conditions and actions do not have unsupported operations on enumeration type operands

Transition uses one of the following unsupported operations on an enumeration type operand:

  • + or +=

  • - or -=

  • * or *=

  • / or /=

  • & or &=

  • | or |=

  • ^ or ^=

  • %%

  • ~

  • || or &&

  • > or <

  • <= or >=

  • ~= or <>

  • >> or <<

Modify the transition to avoid using unsupported operations on enumeration type operands.
Check that no transitions have event triggers Transition has an event trigger, which is not supported for code inspection.Modify the transition to avoid using an event trigger.
Check data type of Graphical Function argumentsTransition specifies graphical function calls with different actual and expected argument data types.Modify the transition to specify graphical function calls with the same data types for actual and expected arguments.
Check dimensions of Graphical Function argumentsTransition specifies graphical function calls with different actual and expected argument sizes.Modify the transition to specify graphical function calls with the same size for actual and expected arguments.
Check that transitions do not have transition actions Transitions has a transition action, which is not supported for code inspection.Modify the transition to avoid using a transition action.
Check that Stateflow transitions do not reuse induction variables outside of a loopTransition has an unsupported induction variable reuse.Modify the transition so that the induction variable is not reused.
Check that no actions contain a function whose argument is of an invalid data type

Math function in an action is not a:

  • Single or double type argument for the following functions:

    • acos, asin, atan

    • ceil, cosh, cosh

    • exp, fabs, floor

    • fmod, ldexp, log

    • log10, pow, sin

    • sinh, sqrt, tan, tanh

  • Non-boolean argument for the following functions:

    • abs, max, min

  • Integer type argument for the labs function.

Modify the math function to use supported data types.
Check that transitions do not have an unsupported loop stepTransition has an unsupported loop step.Modify the transition so that there is a single action statement that increments the int32 scalar loop induction step with a literal int32 constant value.
Check that transitions do not have an unsupported loop bodyTransition has an unsupported loop body.Modify the transition so that there are no actions that redefine the loop induction variable.
Check that transitions do not have an unsupported loop conditionTransition has an unsupported loop condition.Modify the transition condition so that it has either a single < or a single <= condition with a literal int32 constant bound and a scalar int32 loop induction variable.
Check for valid induction variable in transition that defines loop conditionTransition that defines loop condition has an invalid induction variable.Modify the loop condition so that it has only one < or <= condition with a scalar Stateflow local or temporary scope loop induction variable.
Check that transitions do not have unsupported loop induction variable initializationTransition has unsupported loop induction variable initialization.Modify the transition so that initialization of the scalar loop induction variable is a single action statement that uses an int32 data type and initializes the variable with a literal constant int32 value.
Check that no actions contain an xor operator with boolean operandsAction contains an XOR operator with boolean operands with model parameter Casting modes set to Standards.Modify the action to avoid using an XOR operator with boolean operands, or set Casting modes to Nominal.
Check that no actions contain a binary operator whose operands are of mixed data type Action contains a binary operator of mixed data type operands, which is not supported for code inspection.Modify the chart to avoid using binary operators with operands of mixed data type.
Check that no transitions have a function with more than 2 argumentsTransition has a function with more than 2 arguments.Modify each function to have no more than 2 arguments. It might be possible to replace a function with more than 2 arguments with a series of functions that have no more than 2 arguments. For example, a MinMax function with 3 inputs could be replaced with 2 MinMax functions, each with 2 arguments.
Check data type of Simulink Function argumentThe actual Simulink function call argument data type differs from the argument data type of the inport and outport in the defining Function-Call Subsystem.Modify the Simulink function call to have the same argument data type as the inport and outport in the defining Function-Call Subsystem.
Check dimension of Simulink Function argumentThe actual Simulink function call argument size differs from the argument size of the inport and outport in the defining Function-Call Subsystem.Modify the Simulink function call to have the same argument data size as the inport and outport in the defining Function-Call Subsystem.
Check that no actions access time (t) Action accesses time, which is not supported for code inspection.Modify the action to avoid accessing time.
Check data type of truth table argumentsTransition specifies a truth table with different actual and expected argument data types.Modify the transition to specify truth tables to use the same data types for actual and expected arguments.
Check dimensions of truth table argumentsTransition specifies a truth table with different actual and expected argument sizes.Modify the transition to specify truth tables to use the same sizes for actual and expected arguments.
Check unassigned graphical function outputsA chart specifies graphical function calls with a different number of actual and expected outputs.Modify the chart so that graphical functions assign all outputs.
Check that Stateflow transitions are not configured as variant transitionsStateflow chart contains transitions that are configured as variant transitions.Modify the chart to avoid using variant transitions.

See Also

Check usage of Stateflow junctions

Check ID: mathworks.slci.junctionsSFObjsUsage

Check for usage of Stateflow junctions that might impact compatibility with Simulink Code Inspector.

Description

This check updates the model diagram and reports incompatibilities it finds in Stateflow junctions.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Check that Stateflow junctions do not have outgoing transitions jumping outside of the loopJunction has an outgoing transition that jumps outside of a loop body.Modify the chart so that a junction within a loop does not have outgoing transitions jumping outside of the loop.
Check that non-terminating junctions have exactly one unconditional exiting transitionNon-terminating junction does not have exactly one unconditional exiting transition. A single unconditional exiting transition prevents backtracking and transition shadowing.Modify junction so that it has one unconditional exiting transition.
Check that the chart uses no history junctions Chart contains a history junction.Modify chart so that it does not contain a history junction.
Check that control flows do not have loops with unsupported header junctionsHeader junction does not have two incoming and two outgoing transitions.Modify header junction so that it has two incoming and two outgoing transitions.
Check usage of terminating Stateflow junctionsTerminating junction traces back to a Stateflow state.Modify the junction so that it does not trace back to a Stateflow state.
Check that control flows are structured Chart contains unstructured control flows, which are not supported for code inspection.Modify the chart so that it does not contain unstructured control flows.
Check that unconditional transitions execute last in execution order Unconditional transition is not last in order of execution. Modify chart so that the unconditional transition is the last in order of execution. This prevents transition shadowing.

See Also

Check usage of Stateflow data

Check ID: mathworks.slci.dataSFObjsUsage

Check for usage of Stateflow data that might impact compatibility with Simulink Code Inspector.

Description

This check updates the model diagram and reports incompatibilities it finds in Stateflow data.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Check that the chart does not define Stateflow data with Constant scope Chart defines Stateflow data with Constant scope.Modify chart to avoid defining Stateflow data with Constant scope.
Check usage of Stateflow data Initialize MethodInitializeMethod for Local or Output scope Stateflow data is set to Parameter. Modify the chart to not set InitializeMethod to Parameter. In the Model Explorer, for Stateflow data withLocal or Output scope, you can set InitializeMethod for the Initial value to Expression.
Check that states and boxes do not define Stateflow dataState or box defines Stateflow data.Modify state or box so that it does not define Stateflow data.
Check that Stateflow data is of a supported data type Chart data types are not builtin, enumerated, or bus. If the chart data type is a bus and chart uses C as the action language, the data is an array of buses or has elements that are arrays of buses. If the chart data type is enumerated, the default value of the data is not 0.Modify chart data types to be builtin, enumerated, or bus. If the chart data type is bus and chart uses C as the action language, modify the chart so that the data is not an array of buses or have elements that are arrays of buses. If the chart data type is enumerated, update the chart so that the enumerated data type has a default value of 0.
Check that the 'First Index' of Stateflow data are empty or 0The First Index property for Stateflow data is not empty or 0.Modify the First Index property of the Stateflow data to be empty or 0.
Check that Stateflow parameter data sizes in Stateflow and the base workspace matchSize of Stateflow parameter data is different in Stateflow and the base workspace.Modify the size of the Stateflow parameter data so that it is the same in Stateflow and the base workspace.
Check that the chart uses only non-complex data Chart uses complex data.Modify chart so that it does not use complex data.

See Also

Check usage of Stateflow events

Check ID: mathworks.slci.eventsSFObjsUsage

Check for usage of Stateflow events that might impact compatibility with Simulink Code Inspector.

Description

This check updates the model diagram and reports incompatibilities it finds in Stateflow events.

Available with Simulink Code Inspector.

Results and Recommended Actions

CheckConditionRecommended Action
Check that the chart uses only events of scope Local or OutputEvent scope is not Output or Local.Modify charts to avoid using input events.
Check that the chart uses only function-call eventsEvent trigger is not function-call.Modify model so that event trigger is function-call

See Also

Check usage of Stateflow states

Check ID: mathworks.slci.statesSFObjsUsage

Check for usage of Stateflow states that might impact compatibility with Simulink Code Inspector.

Description

This check updates the model diagram and reports incompatibilities it finds in Stateflow states.

Available with Simulink Code Inspector.

Results and Recommended Actions

CheckConditionRecommended Action
Check that control flows do not have cyclesChart contains control flow cycles, which are not supported for code inspection.Configure the chart so that it does not contain control flow cycles.
Check that actions do not have unsupported operations

Action uses an operation that is not:

  • := or =

  • + , += , -, or -=

  • * , *=, / or /=

  • &, && or &=

  • |, || or |=

  • << or >>

  • cast()

  • ^ or ^=

  • %% or <

  • <= or ==

  • ~= or !=

  • <> or >

  • >= or ~

Modify the chart so that action uses only supported operations.
Check for indexing in arrays that are more than one dimension

Array of more than one dimension uses indexing.

Modify the state to use one-dimensional arrays or avoid indexing for arrays that are more than one dimension.
Check that all arrays use index of type 'int32' Array does not use index of data type int32.Modify the array index so that it uses data type int32.
Check that no actions access context-sensitive constantsAction uses context-sensitive constants, which is not supported for code inspection.Modify the action to avoid using context-sensitive constants.
Check that no actions access custom dataAction accesses custom data, which is not supported for code inspection.Modify the action to avoid accessing custom data.
Check that states or substates have a default transitionChart has a state or a substate without a default transition.Configure the chart so that states and substates have default transitions.
Check that actions do not have unsupported operations on enumeration type operands

State uses one of the following unsupported operations on an enumeration type operand:

  • + or +=

  • - or -=

  • * or *=

  • / or /=

  • & or &=

  • | or |=

  • ^ or ^=

  • %%

Modify the state to avoid using unsupported operations on enumeration type operands.
Check data type of Graphical Function argumentsState specifies graphical function calls with different actual and expected argument data types.Modify the state to specify graphical function calls with the same data types for actual and expected arguments.
Check dimensions of Graphical Function argumentsState specifies graphical function calls with different actual and expected argument sizes.Modify the state to specify graphical function calls with the same size for actual and expected arguments.
Check that no actions contain a function whose argument is of an invalid data type

Math function in an action is not a:

  • Single or double type argument for the following functions:

    • acos, asin, atan

    • ceil, cosh, cosh

    • exp, fabs, floor

    • fmod, ldexp, log

    • log10, pow, sin

    • sinh, sqrt, tan, tanh

  • Non-boolean argument for the following functions:

    • abs, max, min

  • Integer type argument for the labs function.

Modify the math function to use supported data types.
Check that no actions contain an xor operator with boolean operandsAction contains an XOR operator with boolean operands with model parameter Casting modes set to Standards.Modify the action to avoid using an XOR operator with boolean operands, or set Casting modes to Nominal.
Check that no actions contain a binary operator whose operands are of mixed data typeAction contains a binary operator of mixed data type operands, which is not supported for code inspection.Modify the chart to avoid using binary operators with operands of mixed data type.
Check that no Stateflow functions have more than 2 argumentsStateflow function has more than 2 arguments.Modify the Stateflow function to have no more than 2 arguments. It might be possible to replace the function with a series of functions, each with no more than 2 arguments.
Check usage of States with recursive send function callsState contains recursive send function calls.Modify the state so that there are no recursions.
Check data type of Simulink Function argumentsState specifies a function call with different actual and expected argument data types.Modify the state to specify Simulink function calls to use the same data types for actual and expected arguments.
Check dimensions of Simulink Function argumentsState specifies a function call with different actual and expected argument sizes.Modify the state to specify Simulink function calls to use the same sizes for actual and expected arguments.
Check usage of Stateflow state InlineOptionState property Function Inline Option is set to Auto or Function.Set state property Function Inline Option to Inline.
Check that all states unselect ‘Create data for monitoring’ optionState property Create data for monitoring is selected (set to on).Clear the state property Create data for monitoring parameter.
Check that no actions access time (t)Action accesses time, which is not supported for code inspection.Modify the action to avoid accessing time.
Check data type of truth table argumentsState specifies a truth table with different actual and expected argument data types.Modify the state to specify truth tables to use the same data types for actual and expected arguments.
Check dimensions of truth table argumentsState specifies a truth table with different actual and expected argument sizes.Modify the state to specify truth tables to use the same sizes for actual and expected arguments.
Check that control flows are structuredState contains unstructured control flows, which are not supported for code inspection.Configure the chart so that it does not contain unstructured control flows.
Check that all control flows have unique default transitionsControl flow has more than 1 default transition.Configure the chart so that it has 1 default transition.
Check that all transition paths are either inner transitions to a substate, or outer transitions to siblings, direct parent, or direct substates

The state uses a transition path that is not one of the following:

  • Inner to substate

  • Outer to sibling

  • Direct parent

  • Direct substate

Configure the transitions so that it uses a supported path.
Check unassigned graphical function outputsA chart specifies graphical function calls with a different number of actual and expected outputs.Modify the chart so that graphical functions assign all outputs.

See Also

Check usage of Stateflow graphical functions

Check ID: mathworks.slci.graphicalfunctionsSFObjsUsage

Check for usage of Stateflow graphical functions that might impact compatibility with Simulink Code Inspector.

Description

This check updates the model diagram and reports incompatibilities it finds in Stateflow graphical functions.

Available with Simulink Code Inspector.

Results and Recommended Actions

CheckConditionRecommended Action
Check that control flows do not have cyclesGraphical function contains control flow cycles, which are not supported for code inspection.Configure the graphical function so that it does not contain control flow cycles.
Check usage of InlineOption settingGraphical function property Function Inline Option is set to Auto.Set graphical function property Function Inline Option to Inline or Function.
Check configuration for models with non-inlined graphical functionsFor a graphical function with Function Inline Option (InlineOption) set to Function, the configuration parameter Code interface packaging (CodeInterfacePackaging) is not set to Nonreusable functionIn the Configuration Parameters dialog box, on the Code Generation > Interface pane, set Code interface packaging (Simulink Coder) to Nonreusable function.
Check non-inlined graphical function namesNon-inlined function does not have a unique function name.Modify the function names of non-inlined graphical functions to be unique.
Check usage of recursive Stateflow functionGraphical function is recursive.Configure the graphical function so that it is not recursive.
Check that control flows are structuredGraphical function contains unstructured control flows, which are not supported for code inspection.Configure the graphical function so that it does not contain unstructured control flows.

See Also

Check usage of Stateflow truth tables

Check ID: mathworks.slci.truthtablesSFObjsUsage

Check for usage of Stateflow truth tables that might impact compatibility with Simulink Code Inspector.

Description

This check updates the model diagram and reports incompatibilities it finds in Stateflow truth tables.

Available with Simulink Code Inspector.

Results and Recommended Actions

CheckConditionRecommended Action
Check that control flows do not have cyclesTruth table contains control flow cycles, which are not supported for code inspection.Configure the truth table so that it does not contain control flow cycles.
Check usage of InlineOption settingTruth table property Function Inline Option is set to Auto or Function.Set truth table property Function Inline Option to Inline.
Check usage of recursive Stateflow functionTruth table is recursive.Configure the truth table so that it is not recursive.
Check usage of Stateflow truth table languageTruth table property Language is set to MATLAB.Set Language to C.
Check that control flows are structuredTruth table contains unstructured control flows, which are not supported for code inspection.Configure the truth table so that it does not contain unstructured control flows.

See Also

Check usage of MATLAB Function Blocks

Check ID: mathworks.slci.MATLABFunctionBlocksUsage

Identify MATLAB Function blocks that might impact compatibility with Simulink Code Inspector.

Description

This check updates the model diagram and reports incompatibilities it finds in MATLAB Function blocks.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Check for block names that contain ‘/*’,’*/’, or start or end with the character ‘*’

Block name:

  • Contains ‘*/’ or ‘/*’.

  • Starts or ends with ‘*’.

Modify the listed block name.
Check for unsupported usage of storage classBlock is constant and has outports of non-auto storage class.Modify the block by either changing the output signal storage class, or modifying the block’s sample time. For example, if the block or its source is a Constant block, set the sample time of that Constant block to an explicit, non-constant sample time.
Check for unsupported testpointsBlock is constant and an outport is testpointed.Modify the block by either removing the output signal testpoints, or modifying the block’s sample time. For example, if the block or its source is a Constant block, set the sample time of that Constant block to an explicit, non-constant sample time.
Check storage class of block outportsBlock is using unsupported custom storage class Type, Data initialization, or InitialValue (InitialValue).

Modify the output custom signal storage class:

  • Type is set to Unstructured.

  • Data initialization is set to a value other than None.

  • Initial value (InitialValue) is empty.

Check for blocks with greater than two-dimensional inputs or outputsBlock inport or outport is not a scalar, vector, or 2–D matrix.Modify block inport or outport to be a scalar, vector, or 2–D matrix.
Check whether inputs and outputs are not framedBlock inport or outport uses frame-based signals.Modify the model so that blocks use sample-based inports and outports. Check upstream blocks of the blocks listed in the results for blocks that output frame-based signals.
Check that all MATLAB functions set ‘Update method’ to ‘Inherited’MATLAB function does not set Update method to Inherited.Modify the MATLAB function to set Update method to Inherited.
Identify Subsystems that have unsupported configurations for non-inlinedFor MATLAB Function block, Function packaging (RTWSystemCode) is not set to Inline.Modify the MATLAB Function block to set Function packaging (RTWSystemCode) to Inline, Nonreusable function or Reusable function. If you select Nonreusable function, the subsystem must be in the following configurations:
  • Set Function name options to User Specified.

  • Set Function interface to void-void.

  • Set Function with separate data to off.

  • Set model parameter Code interface packaging to Nonreusable function.

If you select Reusable function, the model must use the following configurations:
  • Pass reusable subsystem outputs as to Individual arguments

  • Set model parameter Code interface packaging to Nonreusable function.

Check that reusable subsystems in a model are from a library and are unmasked single-rate atomic or function-call subsystemsThe reusable subsystems in the model are not from a library and are not unmasked single-rate atomic or function -call subsystems. Modify the reusable subsystems in the model so that they are from a library. These subsystems must be unmasked single-rate atomic or function-call subsystems.
Check that MATLAB functions do not contain input Trigger signalsMATLAB function contains input Trigger signals.Modify the MATLAB function to remove the usage of input Trigger signals.
Check that blocks that are constant or whose parameters can be tuned, do not drive two or more multirate blocks without using explicit rate transition blocksBlock that is constant or has parameters that can be tuned drives two or more multirate blocks without using explicit Rate Transition blocks.Modify the block to use explicit Rate Transition blocks.
Check that all MATLAB functions set ‘Saturate on integer overflow’ to ‘Off’MATLAB function does not clear (set to off) the Saturate on integer overflow (SaturateOnIntegerOverflow) parameter.Modify the MATLAB function to clear (set to off) the Saturate on integer overflow (SaturateOnIntegerOverflow) parameter.
Check that all MATLAB functions set ‘Treat these inherited Simulink signal types as fi objects:’ to a value other than ‘Fixed-point & Integer’MATLAB function sets Treat these inherited Simulink signal types as fi objects to Fixed-point & Integer.Modify the MATLAB function to set Treat these inherited Simulink signal types as fi objects to a value other than Fixed-point & Integer.
Check that all MATLAB functions set ‘Support variable-size arrays’ to ‘Off’MATLAB function does not clear (set to off) the Support variable-size arrays parameter.Modify the MATLAB function to clear (set to off) the Support variable-size arrays parameter.

See Also

Check usage of Data in MATLAB Functions

Check ID: mathworks.slci.MATLABFunctionDataUsage

Identify data in MATLAB functions that might impact compatibility with Simulink Code Inspector.

Description

This check updates the model diagram and reports incompatibilities it finds with data in MATLAB functions.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Check that data defined in MATLAB function is of a supported data typeData is not of a supported data type: built-in, bus, or an enumerated type inherited from Simulink.IntEnumType.Modify the data to be a supported data type.
Check that data defined in MATLAB function is of a supported dimensionData is not a scalar, vector, or matrix.Modify the data to be a scalar, vector, or matrix.
Check that data defined in MATLAB function is non-complexData is complex.Modify the MATLAB function to avoid using complex data.

See Also

Check usage of root Outport blocks

Check ID: mathworks.slci.RootOutportBlocksUsage

Check for usage of root Outport blocks that might impact compatibility with Simulink Code Inspector.

Description

This check updates the model diagram and reports root Outport block usage incompatibilities.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Verify sample timesOne or more root Outport blocks are constant. This will cause the model functions to fail validation, because the root outport assignment is moved to the model initialize function.Set the sample times of the root Outport blocks to explicit, nonconstant sample times.
Verify root Outports pass buses to parent models as structuresOne or more root Outport blocks pass a bus to the parent model without passing the bus as a structure. This might cause Simulink software to insert a hidden Signal Conversion block in the parent model, which is not supported for code inspection.For each instance, open the Outport block dialog box and select the parameter Output as nonvirtual bus in parent model (BusOutputAsStruct).

See Also

Model-Wide Attribute Constraints

Check usage of buses

Check ID: mathworks.slci.BusUsage

Check for usage of buses that might impact compatibility with Simulink Code Inspector.

Description

This check updates the model diagram and reports bus usage incompatibilities.

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Check for automatic conversion between virtual to nonvirtual busesSimulink software performed an automatic conversion from a virtual to a nonvirtual bus at the interface of one or more listed blocks. This creates a hidden Signal Conversion block, which is not supported for code inspection.Modify the model to use nonvirtual buses at the interfaces of the listed blocks.
Verify that blocks in the model do not perform unsupported operations on a busIn the model, a non-virtual block operates on a virtual bus or a Bus Assignment block operates on a non-virtual bus.Modify the model so that no non-virtual blocks operate on a virtual bus and no Bus Assignment blocks operate on a non-virtual bus. This action simplifies bus processing to promote traceability and readability of generated code.

See Also

Model-Wide Attribute Constraints

Check usage of shared utilities

Check ID: mathworks.slci.SharedUtils

Check for usage of shared utilities that might impact compatibility with Simulink Code Inspector.

Description

This check updates the model diagram and identifies incompatibilities with shared utilities usage.

Supported shared utilities include:

  • binsearch_u32d

  • intrp1d_l

  • intrp2d_l

  • intrp3d_l

  • look1_binlc

  • look2_binlc

  • plook_binlc

  • rt_hypotd

  • rt_hypotf

  • rt_modd

  • rt_modf

  • rt_remd

  • rt_remf

  • rt_roundd

  • rt_roundf

Available with Simulink Code Inspector.

Results and Recommended Actions

SubcheckConditionRecommended Action
Check code generation symbols settings for shared utils inspectionValues for code generation symbols parameters are not supported for shared utilities inspection.In the Configuration Parameters dialog box, on the Code Generation > Identifiers pane, set Local temporary variables (Embedded Coder) to default value $N$M and set Shared utilities identifier format (Embedded Coder) to default value $N$C.
Check standard math library settings for shared utils inspectionStandard math library settings are not supported for shared utilities inspection.In the Configuration Parameters dialog box, on the Code Generation > Interface pane, set Standard math library (Simulink Coder) to C89/C90 (ANSI) or C99.
Check code style settings for shared utils inspectionValues for code style configuration parameters are not supported for shared utilities inspection.

In the Configuration Parameters dialog box, on the Code Generation > Code Style pane:

See Also

Model-Wide Attribute Constraints