Documentation

MathWorks Automotive Advisory Board Checks

MathWorks Automotive Advisory Board Checks

MathWorks® Automotive Advisory Board (MAAB) checks facilitate designing and troubleshooting models from which code is generated for automotive applications.

The Model Advisor performs a checkout of the Simulink® Verification and Validation™ license when you run the MAAB checks.

See Also

Check font formatting

Check ID: mathworks.maab.db_0043

Check for difference in font and font sizes.

Description

With the exception of free text annotations within a model, text elements, such as block names, block annotations, and signal labels, must have the same font style and font size. Select a font style and font size that is legible and portable (convertible between platforms), such as Arial or Times New Roman 12 point.

Available with Simulink Verification and Validation.

Input Parameters

Font Name

Apply the specified font to all text elements. When you specify Common (default), the check identifies different fonts used in your model. Although you can specify other fonts, the fonts available from the drop-down list are Arial, Courier New, Georgia, Times New Roman, Arial Black, and Verdana.

Font Size

Apply the specified font size to all text elements. When you specify Common (default), the check identifies different font sizes used in your model. Although you can specify other font sizes, the font sizes available from the drop-down list are 6, 8, 9, 10, 12, 14, 16.

Font Style

Apply the specified font style to all text elements. When you specify Common (default), the check identifies different font styles used in your model. The font styles available from the drop-down list are normal, bold, italic, and bold italic.

Results and Recommended Actions

ConditionRecommended Action
The fonts or font sizes for text elements in the model are not consistent or portable.Specify values for the font parameters and click Modify all Fonts, or manually change the fonts and font sizes of text elements in the model so they are consistent and portable.

Capabilities and Limitations

  • Runs on library models.

  • Does not analyze content of library linked blocks.

  • Analyzes content in masked subsystems that have no workspaces and no dialogs.

  • Allows exclusions of blocks and charts.

Action Results

Clicking Modify all Fonts changes the font and font size of all text elements in the model according to the values you specify in the input parameters.

For the input parameters, if you specify Common, clicking Modify all Fonts changes the font and font sizes of all text elements in the model to the most commonly used fonts, font sizes, or font styles.

See Also

Check transition orientations in flow charts

Check ID: mathworks.maab.db_0132

Check transition orientations in flow charts.

Description

The following rules apply to transitions in flow charts:

  • Draw transition conditions horizontally.

  • Draw transitions with a condition action vertically.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
The model includes a transition with a condition that is not drawn horizontally or a transition action that is not drawn vertically.Modify the model.

Capabilities and Limitations

  • MAAB guideline, Version 3.0 limitation: Although db_0132: Transitions in flow charts has an exception for loop constructs, the check does flag flow charts containing loop constructs if the transition violates the orientation rule.

  • JMAAB guideline, Version 4.0 limitation: The check only flags flow charts containing loop constructs if the transition violates the orientation rule.

  • Runs on library models.

  • Does not analyze content of library linked blocks.

  • Analyzes content in all masked subsystems.

  • Allows exclusions of blocks and charts.

See Also

Check for nondefault block attributes

Check ID: mathworks.maab.db_0140

Identify blocks that use nondefault block parameter values that are not displayed in the model diagram.

Description

Model diagrams should display block parameters that have values other than default values. One way of displaying this information is by using the Block Annotation tab in the Block Properties dialog box.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Block parameters that have values other than default values, and the values are not in the model display.In the Block Properties dialog, use the Block Annotation tab to add block parameter annotations.

Capabilities and Limitations

  • JMAAB guideline, Version 4.0 limitation: The check flags masked blocks that display parameter information but do not use block annotations. JMAAB 4.0 guidelines allow masked blocks to display parameter information.

  • Runs on library models.

  • Analyzes content of library linked blocks.

  • Analyzes content in masked subsystems that have no workspaces and no dialogs.

  • Allows exclusions of blocks and charts.

Tip

If you use the add_block function with 'built-in/blocktype' as a source block path name for Simulink built-in blocks, some default parameter values of some blocks are different from the defaults that you get if you added those blocks interactively using Simulink.

See Also

Check signal line labels

Check ID: mathworks.maab.na_0008

Check the labeling on signal lines.

Description

Use a label to identify:

  • Signals originating from the following blocks (the block icon exception noted below applies to all blocks listed, except Inport, Bus Selector, Demux, and Selector):

    Bus Selector block (tool forces labeling)
    Chart block (Stateflow)
    Constant block
    Data Store Read block
    Demux block
    From block
    Inport block
    Selector block
    Subsystem block

      Block Icon Exception   If a signal label is visible in the display of the icon for the originating block, you do not have to display a label for the connected signal unless the signal label is required elsewhere due to a rule for signal destinations.

  • Signals connected to one of the following destination blocks (directly or indirectly with a basic block that performs an operation that is not transformative):

    Bus Creator block
    Chart block (Stateflow)
    Data Store Write block
    Goto block
    Mux block
    Outport block
    Subsystem block
  • Any signal of interest.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Signals coming from Bus Selector, Chart, Constant, Data Store Read, Demux, From, Inport, or Selector blocks are not labeled.Double-click the line that represents the signal. After the text cursor appears, enter a name and click anywhere outside the label to exit label editing mode.

Capabilities and Limitations

  • Runs on library models.

  • Analyzes content of library linked blocks.

  • Analyzes content in masked subsystems that have no workspaces and no dialogs.

  • Does not allow exclusions of blocks or charts.

See Also

Check for propagated signal labels

Check ID: mathworks.maab.na_0009

Check for propagated labels on signal lines.

Description

You should propagate a signal label from its source rather than enter the signal label explicitly (manually) if the signal originates from:

  • An Inport block in a nested subsystem. However, if the nested subsystem is a library subsystem, you can explicitly label the signal coming from the Inport block to accommodate reuse of the library block.

  • A basic block that performs a nontransformative operation.

  • A Subsystem or Stateflow Chart block. However, if the connection originates from the output of an instance of the library block, you can explicitly label the signal to accommodate reuse of the library block.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
The model includes signal labels that were entered explicitly, but should be propagated. Use the open angle bracket (<) character to mark signal labels that should be propagated and remove the labels that were entered explicitly.

Capabilities and Limitations

  • Does not run on library models.

  • Analyzes content of library linked blocks.

  • Analyzes content in masked subsystems that have no workspaces and no dialogs.

  • Does not allow exclusions of blocks or charts.

See Also

Check default transition placement in Stateflow charts

Check ID: mathworks.maab.jc_0531

Check default transition placement in Stateflow charts.

Description

In a Stateflow chart, you should connect the default transition at the top of the state and place the destination state of the default transition above other states in the hierarchy.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
The default transition for a Stateflow chart is not connected at the top of the state.Move the default transition to the top of the Stateflow chart.
The destination state of a Stateflow chart default transition is lower than other states in the same hierarchy.Adjust the position of the default transition destination state so that the state is above other states in the same hierarchy.

Capabilities and Limitations

  • Runs on library models.

  • Does not analyze content of library linked blocks.

  • Analyzes content in all masked subsystems.

  • Allows exclusions of blocks and charts.

See Also

Check return value assignments of graphical functions in Stateflow charts

Check ID: mathworks.maab.jc_0511

Identify graphical functions with multiple assignments of return values in Stateflow charts.

Description

The return value from a Stateflow graphical function must be set in only one place.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
The return value from a Stateflow graphical function is assigned in multiple places.Modify the specified graphical function so that its return value is set in one place.

Capabilities and Limitations

  • Runs on library models.

  • Does not analyze content of library linked blocks.

  • Analyzes content in all masked subsystems.

  • Allows exclusions of blocks and charts.

See Also

Check entry formatting in State blocks in Stateflow charts

Check ID: mathworks.maab.jc_0501

Identify missing line breaks between entry action (en), during action (du), and exit action (ex) entries in states. Identify missing line breaks after semicolons (;) in statements.

Description

Start a new line after the entry, during, and exit entries, and after the completion of a statement ";".

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
An entry (en) is not on a new line.Add a new line after the entry.
A during (du) is not on a new line. Add a new line after the during.
An exit (ex) is not on a new line.Add a new line after the exit.
Multiple statements found on one line.Add a new line after each statement.

Capabilities and Limitations

  • Runs on library models.

  • Does not analyze content of library linked blocks.

  • Analyzes content in all masked subsystems.

  • Allows exclusions of blocks and charts.

See Also

MAAB guideline, Version 3.0: jc_0501: Format of entries in a State block in the Simulink documentation.

Check usage of return values from a graphical function in Stateflow charts

Check ID: mathworks.maab.jc_0521

Identify calls to graphical functions in conditional expressions.

Description

Do not use the return value of a graphical function in a comparison operation.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Conditional expressions contain calls to graphical functions.Assign return values of graphical functions to intermediate variables. Use these intermediate variables in the specified conditional expressions.

Capabilities and Limitations

  • Runs on library models.

  • Does not analyze content of library linked blocks.

  • Analyzes content in all masked subsystems.

  • Allows exclusions of blocks and charts.

See Also

Check for pointers in Stateflow charts

Check ID: mathworks.maab.jm_0011

Identify pointer operations on custom code variables.

Description

Pointers to custom code variables are not allowed.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Custom code variables use pointer operations.Modify the specified chart to remove the dependency on pointer operations.

Capabilities and Limitations

  • Applies only to Stateflow charts that use C as the action language.

  • Runs on library models.

  • Does not analyze content of library linked blocks.

  • Analyzes content in all masked subsystems.

  • Allows exclusions of blocks and charts.

See Also

  • MAAB guideline, Version 3.0: jm_0011: Pointers in Stateflow in the Simulink documentation.

  • JMAAB guideline, Version 4.0: jm_0011: Pointers in Stateflow.

Check for event broadcasts in Stateflow charts

Check ID: mathworks.maab.jm_0012

Identify undirected event broadcasts that might cause recursion during simulation and generate inefficient code.

Description

Event broadcasts in Stateflow charts must be directed.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Event broadcasts are undirected.Rearchitect the diagram to use directed event broadcasting. Use the send syntax or qualified event names to direct the event to a particular state. Use multiple send statements to direct an event to more than one state.

Capabilities and Limitations

  • Runs on library models.

  • Does not analyze content of library linked blocks.

  • Analyzes content in all masked subsystems.

  • Allows exclusions of blocks and charts.

See Also

Check transition actions in Stateflow charts

Check ID: mathworks.maab.db_0151

Identify missing line breaks between transition actions.

Description

For readability, start each transition action on a new line.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Multiple transition actions are on a single line.Verify that each transition action begins on a new line.

Capabilities and Limitations

  • Runs on library models.

  • Does not analyze content of library linked blocks.

  • Analyzes content in all masked subsystems.

  • Allows exclusions of blocks and charts.

See Also

Check for MATLAB expressions in Stateflow charts

Check ID: mathworks.maab.db_0127

Identify Stateflow objects that use MATLAB expressions that are not suitable for code generation.

Description

Do not use MATLAB functions, instructions, and operators in Stateflow objects.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Stateflow objects use MATLAB expressions.Replace MATLAB expressions in Stateflow objects.

Capabilities and Limitations

  • Applies only to Stateflow charts that use C as the action language.

  • Runs on library models.

  • Does not analyze content of library linked blocks.

  • Analyzes content in all masked subsystems.

  • Allows exclusions of blocks and charts.

See Also

Check for indexing in blocks

Check ID: mathworks.maab.db_0112

Check that blocks use consistent vector indexing.

Description

Check that blocks use consistent vector indexing. When possible, use zero-based indexing to improve code efficiency.

Available with Simulink Verification and Validation.

The check verifies consistent indexing for the following objects:

ObjectIndexing
  • Assignment block

  • For Iterator block

  • Find block

  • Multiport Switch block

  • Selector block

  • Zero-based indexing ([0, 1, 2, ...])

  • One-based indexing ([1, 2, 3,...])

  • Stateflow charts with C action language

Zero-based indexing ([0, 1, 2, ...])
  • MATLAB Function block

  • Fcn block

  • MATLAB System blocks

  • Truth tables

  • State transition tables

  • Stateflow charts with MATLAB action language

  • MATLAB functions inside Stateflow charts

One-based indexing ([1, 2, 3,...])

Results and Recommended Actions

ConditionRecommended Action
Objects in your model use one-based indexing, but can be configured for zero-based indexing.Configure objects for zero-based indexing.
Objects in your model use inconsistent indexing.If possible, configure objects for zero-based indexing. If your model contains objects that cannot be configured for zero-based indexing, configure objects for one-based indexing.

Capabilities and Limitations

  • Runs on library models.

  • Analyzes content of library linked blocks.

  • Analyzes content in all masked subsystems.

  • Allows exclusions of blocks and charts.

See Also

  • MAAB guideline, Version 3.0: db_0112: Indexing in the Simulink documentation.

  • JMAAB guideline, Version 4.0: db_0112: Indexing.

Check file names

Check ID: mathworks.maab.ar_0001

Checks the names of all files residing in the same folder as the model

Description

A file name conforms to constraints.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
The file name contains illegal characters. Rename the file. Allowed characters are a–z, A–Z, 0–9. and underscore (_).
The file name starts with a number.Rename the file.
The file name starts with an underscore ("_"). Rename the file.
The file name ends with an underscore ("_"). Rename the file.
The file extension contains one (or more) underscores. Change the file extension.
The file name has consecutive underscores. Rename the file.
The file name contains more than one dot ("."). Rename the file.

Capabilities and Limitations

  • MAAB guideline, Version 3.0 limitation: The check does not flag conflicts with C++ keywords.

  • Runs on library models.

  • Does not allow exclusions of blocks or charts.

See Also

  • MAAB guideline, Version 3.0: ar_0001: Filenames in the Simulink documentation.

  • JMAAB guideline, Version 4.0: ar_0001: Usable characters for filenames.

Check folder names

Check ID: mathworks.maab.ar_0002

Checks model directory and subdirectory names for invalid characters.

Description

A directory name conforms to constraints.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
The directory name contains illegal characters. Rename the directory. Allowed characters are a–z, A–Z, 0–9. and underscore (_).
The directory name starts with a number. Rename the directory.
The directory name starts with an underscore ("_"). Rename the directory.
The directory name ends with an underscore ("_").Rename the directory.
The directory name has consecutive underscores. Rename the directory.

Capabilities and Limitations

  • Runs on library models.

  • Does not allow exclusions of blocks or charts.

See Also

  • MAAB guideline, Version 3.0: ar_0002: Directory names in the Simulink documentation.

  • JMAAB guideline, Version 4.0: ar_0002: Usable characters for folder names.

Check for prohibited blocks in discrete controllers

Check ID: mathworks.maab.jm_0001

Check for prohibited blocks in discrete controllers.

Description

The check identifies continuous blocks in discrete controller models.

Available with Simulink Verification and Validation.

Input Parameters

To change the list of blocks that the check flags, you can use the Model Advisor Configuration Editor.

  1. Open the Model Configuration Editor and navigate to Check for prohibited blocks in discrete controllers.

  2. In the Input Parameters pane, to:

    • Prohibit the blocks as specified in MAAB 3.0, from Standard, select MAAB 3.0. The Block type list table provides the blocks that MAAB 3.0 prohibits inside controllers.

    • To specify blocks to either allow or prohibit, from Standard, select Custom. In Treat blocktype list as, select Allowed or Prohibited. In the Block type list table, you can add or remove blocks.

  3. Click Apply.

  4. Save the configuration. When you run the check using this configuration, the check uses the specified input parameters.

Results and Recommended Actions

ConditionRecommended Action
Continuous blocks — Derivative, Integrator, State-Space, Transfer Fcn, Transfer Delay, Variable Time Delay, Variable Transport Delay, and Zero-Pole — are not permitted in models representing discrete controllers.Replace continuous blocks with the equivalent blocks discretized in the s-domain. Use the Discretizing library, as described in Discretize Blocks from the Simulink Model in the Simulink documentation.

Capabilities and Limitations

  • Runs on library models.

  • Analyzes content of library linked blocks.

  • Analyzes content in all masked subsystems.

  • Allows exclusions of blocks and charts.

See Also

Check for prohibited sink blocks

Check ID: mathworks.maab.hd_0001

Check for prohibited Simulink sink blocks.

Description

You must design controller models from discrete blocks. Sink blocks, such as the Scope block, are not allowed in controller models.

Available with Simulink Verification and Validation.

Input Parameters

To change the list of blocks that the check flags, you can use the Model Advisor Configuration Editor.

  1. Open the Model Configuration Editor and navigate to Check for prohibited sink blocks.

  2. In the Input Parameters pane, to:

    • Prohibit the blocks as specified by MAAB 3.0, from Standard, select MAAB 3.0. The Block type list table provides the sink blocks that MAAB 3.0 prohibits.

    • To specify blocks to either allow or prohibit, from Standard, select Custom. In Treat blocktype list as, select Allowed or Prohibited. In the Block type list table, you can add or remove blocks.

  3. Click Apply.

  4. Save the configuration. When you run the check using this configuration, the check uses the specified input parameters.

Results and Recommended Actions

ConditionRecommended Action
Sink blocks are not permitted in discrete controllers. Remove sink blocks from the model.

Capabilities and Limitations

  • Runs on library models.

  • Analyzes content of library linked blocks.

  • Analyzes content in all masked subsystems.

  • Allows exclusions of blocks and charts.

See Also

Check positioning and configuration of ports

Check ID: mathworks.maab.db_0042

Check whether the model contains ports with invalid position and configuration.

Description

In models, ports must comply with the following rules:

  • Place Inport blocks on the left side of the diagram. Move the Inport block right only to prevent signal crossings.

  • Place Outport blocks on the right side of the diagram. Move the Outport block left only to prevent signal crossings.

  • Avoid using duplicate Inport blocks at the subsystem level if possible.

  • Do not use duplicate Inport blocks at the root level.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Inport blocks are too far to the right and result in left-flowing signals. Move the specified Inport blocks to the left.
Outport blocks are too far to the left and result in right-flowing signals. Move the specified Output blocks to the right.
Ports do not have the default orientation. Modify the model diagram such that signal lines for output ports enter the side of the block and signal lines for input ports exit the right side of the block.
Ports are duplicate Inport blocks.
  • If the duplicate Inport blocks are in a subsystem, remove them where possible.

  • If the duplicate Inport blocks are at the root level, remove them.

Capabilities and Limitations

  • Runs on library models.

  • Analyzes content of library linked blocks.

  • Analyzes content in all masked subsystems.

  • Allows exclusions of blocks and charts.

See Also

Check for matching port and signal names

Check ID: mathworks.maab.jm_0010

Check for mismatches between names of ports and corresponding signals.

Description

Use matching names for ports and their corresponding signals.

Available with Simulink Verification and Validation.

Prerequisite

Prerequisite MAAB guidelines, Version 3.0, for this check are:

Results and Recommended Actions

ConditionRecommended Action
Ports have names that differ from their corresponding signals. Change the port name or the signal name to match the name for the signal.

Capabilities and Limitations

  • Runs on library models.

  • Analyzes content of library linked blocks.

  • Analyzes content in all masked subsystems.

  • Allows exclusions of blocks and charts.

See Also

Check whether block names appear below blocks

Check ID: mathworks.maab.db_0142

Check whether block names appear below blocks.

Description

If shown, the name of the block should appear below the block.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Blocks have names that do not appear below the blocks. Set the name of the block to appear below the blocks.

Capabilities and Limitations

  • Runs on library models.

  • Analyzes content of library linked blocks.

  • Analyzes content in all masked subsystems.

  • Allows exclusions of blocks and charts.

See Also

Check for mixing basic blocks and subsystems

Check ID: mathworks.maab.db_0143

Check for systems that mix primitive blocks and subsystems.

Description

You must design each level of a model with building blocks of the same type, for example, only subsystems or only primitive (basic) blocks. If you mask your subsystem and set MaskType to a nonempty string, the Model Advisor treats the subsystem as a basic block.

Available with Simulink Verification and Validation.

Input Parameters

To change the list of blocks that the check flags, you can use the Model Advisor Configuration Editor.

  1. Open the Model Configuration Editor and navigate to Check for mixing basic blocks and subsystems.

  2. In the Input Parameters pane, to:

    • Allow the blocks specified by MAAB 3.0, from Standard, select MAAB 3.0. The Block type list table provides the blocks that MAAB 3.0 allows at any model level.

    • To specify blocks to either allow or prohibit, from Standard, select Custom. In Treat blocktype list as, select Allowed or Prohibited. In the Block type list table, you can add or remove blocks.

  3. Click Apply.

  4. Save the configuration. When you run the check using this configuration, the check uses the specified input parameters.

Results and Recommended Actions

ConditionRecommended Action
A level in the model includes subsystem blocks and primitive blocks.

Move nonvirtual blocks into the subsystem.

Capabilities and Limitations

  • Runs on library models.

  • Analyzes content of library linked blocks.

  • Analyzes content in all masked subsystems.

  • Allows exclusions of blocks and charts.

See Also

Check for unconnected ports and signal lines

Check ID: mathworks.maab.db_0081

Check whether model has unconnected input ports, output ports, or signal lines.

Description

Unconnected inputs should be connected to ground blocks. Unconnected outputs should be connected to terminator blocks.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Blocks have unconnected inputs or outputs. Connect unconnected lines to blocks specified by the design or to Ground or Terminator blocks.

Capabilities and Limitations

  • Runs on library models.

  • Analyzes content of library linked blocks.

  • Analyzes content in all masked subsystems.

  • Allows exclusions of blocks and charts.

See Also

Check position of Trigger and Enable blocks

Check ID: mathworks.maab.db_0146

Check the position of Trigger and Enable blocks.

Description

Locate blocks that define subsystems as conditional or iterative at the top of the subsystem diagram.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Trigger, Enable, and Action Port blocks are not at the top of the subsystem diagram. Move the Trigger, Enable, and Action Port blocks to the top of the subsystem diagram.

Capabilities and Limitations

  • JMAAB guideline, Version 4.0 limitation: The check does not verify that For Each or For Iterator blocks are uniformly located.

  • Runs on library models.

  • Analyzes content of library linked blocks.

  • Does not analyze content in masked subsystems.

  • Allows exclusions of blocks and charts.

See Also

Check usage of tunable parameters in blocks

Check ID: mathworks.maab.db_0110

Check whether tunable parameters specify expressions, data type conversions, or indexing operations.

Description

To make a parameter tunable, you must enter the basic block without the use of MATLAB calculations or scripting. For example, omit:

  • Expressions

  • Data type conversions

  • Selections of rows or columns

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Blocks have a tunable parameter that specifies an expression, data type conversion, or indexing operation. In each case, move the calculation outside of the block, for example, by performing the calculation with a series of Simulink blocks, or precompute the value as a new variable.

Capabilities and Limitations

  • Runs on library models.

  • Analyzes content of library linked blocks.

  • Analyzes content in all masked subsystems.

  • Does not evaluate mask parameters.

  • Allows exclusions of blocks and charts.

See Also

Check Stateflow data objects with local scope

Check ID: mathworks.maab.db_0125

Check whether Stateflow data objects with local scope are defined at the chart level or below.

Description

You must define local data of a Stateflow block on the chart level or below in the object hierarchy. You cannot define local variables on the machine level; however, parameters and constants are allowed at the machine level.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Local data is not defined in the Stateflow hierarchy at the chart level or below. Define local data at the chart level or below.

Capabilities and Limitations

  • JMAAB guideline, Version 4.0 limitation: The check does not detect if local data has the same name within charts or states that have parent-child relationships.

  • Runs on library models.

  • Does not analyze content of library linked blocks.

  • Analyzes content in all masked subsystems.

  • Does not allow exclusions of blocks or charts.

See Also

Check for Strong Data Typing with Simulink I/O

Check ID: mathworks.maab.db_0122

Check whether labeled Stateflow and Simulink input and output signals are strongly typed.

Description

Strong data typing between Stateflow and Simulink input and output signals is required.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
A Stateflow chart does not use strong data typing with Simulink. Select the Use Strong Data Typing with Simulink I/O check box for the specified block.

Capabilities and Limitations

  • Runs on library models.

  • Does not analyze content of library linked blocks.

  • Analyzes content in all masked subsystems.

  • Allows exclusions of blocks and charts.

See Also

Check usage of exclusive and default states in state machines

Check ID: mathworks.maab.db_0137

Check states in state machines.

Description

In state machines:

  • There must be at least two exclusive states.

  • A state cannot have only one substate.

  • The initial state of a hierarchical level with exclusive states is clearly defined by a default transition.

Available with Simulink Verification and Validation.

Prerequisite

A prerequisite MAAB guideline, Version 3.0, for this check is db_0149: Flow chart patterns for condition actions.

Results and Recommended Actions

ConditionRecommended Action
A system is underspecified.Validate that the intended design is represented in the Stateflow diagram.
Chart has only one exclusive (OR) state. Make the state a parallel state, or add another exclusive (OR) state.
Chart does not have a default state defined.Define a default state.
Chart has multiple default states defined. Define only one default state. Make the others nondefault.
State has only one exclusive (OR) substate. Make the state a parallel state, add another exclusive (OR) state, or replace the state with a flow chart.
State does not have a default substate defined. Define a default substate.
State has multiple default substates defined. Define only one default substate, make the others nondefault.

Capabilities and Limitations

  • Runs on library models.

  • Does not analyze content of library linked blocks.

  • Analyzes content in all masked subsystems.

  • Allows exclusions of blocks and charts.

See Also

MAAB guideline, Version 3.0: db_0137: States in state machines in the Simulink documentation.

Check Implement logic signals as Boolean data (vs. double)

Check ID: mathworks.maab.jc_0011

Check the optimization parameter for Boolean data types.

Description

Optimization for Boolean data types is required

Available with Simulink Verification and Validation.

Prerequisite

A prerequisite MAAB guideline, Version 3.0, for this check is na_0002: Appropriate implementation of fundamental logical and numerical operations.

Results and Recommended Actions

ConditionRecommended Action
Configuration setting for Implement logic signals as boolean data (vs. double) is not set. Select the Implement logic signals as boolean data (vs. double) check box in the Configuration Parameters dialog box All Parameters pane.

Capabilities and Limitations

  • Does not run on library models.

  • Does not allow exclusions of blocks or charts.

See Also

Check model diagnostic parameters

Check ID: mathworks.maab.jc_0021

Check the model diagnostics configuration parameter settings.

Description

You should enable the following diagnostics:

Algebraic loop
Minimize algebraic loop
Inf or NaN block output
Duplicate data store names
Unconnected block input ports
Unconnected block output ports
Unconnected line
Unspecified bus object at root Outport block
Mux blocks used to create bus signals
Element name mismatch
Invalid function-call connection

Diagnostics not listed in the Results and Recommended Actions section below can be set to any value.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Algebraic loop is set to none.Set Algebraic loop on the Diagnostics > Solver pane in the Configuration Parameters dialog box to error or warning. Otherwise, Simulink might attempt to automatically break the algebraic loops, which can impact the execution order of the blocks.
Minimize algebraic loop is set to none. Set Minimize algebraic loop on the Diagnostics > Solver pane in the Configuration Parameters dialog box to error or warning. Otherwise, Simulink might attempt to automatically break the algebraic loops for reference models and atomic subsystems, which can impact the execution order for those models or subsystems.
Inf or NaN block output is set to none, which can result in numerical exceptions in the generated code. Set Inf or NaN block output on the Diagnostics > Data Validity > Signals pane in the Configuration Parameters dialog box to error or warning.
Duplicate data store names is set to none, which can result in nonunique variable naming in the generated code. Set Duplicate data store names on the Diagnostics > Data Validity > Signals pane in the Configuration Parameters dialog box to error or warning.
Unconnected block input ports is set to none, which prevents code generation. Set Unconnected block input ports on the Diagnostics > Data Validity > Signals pane in the Configuration Parameters dialog box to error or warning.
Unconnected block output ports is set to none, which can lead to dead code. Set Unconnected block output ports on the Diagnostics > Data Validity > Signals pane in the Configuration Parameters dialog box to error or warning.
Unconnected line is set to none, which prevents code generation. Set Unconnected line on the Diagnostics > Connectivity > Signals pane in the Configuration Parameters dialog box to error or warning.
Unspecified bus object at root Outport block is set to none, which can lead to an unspecified interface if the model is referenced from another model. Set Unspecified bus object at root Outport block on the Diagnostics > Connectivity > Buses pane in the Configuration Parameters dialog box to error or warning.
Mux blocks used to create bus signals is set to none, which can lead to creating an unintended bus in the model. Set Mux blocks used to create bus signals on the Diagnostics > Connectivity > Buses pane in the Configuration Parameters dialog box to error or warning.
Element name mismatch is set to none, which can lead to an unintended interface in the generated code. Set Element name mismatch on the Diagnostics > Connectivity > Buses pane in the Configuration Parameters dialog box to error or warning.
Invalid function-call connection is set to none, which can lead to an error in the operation of the generated code. Set Invalid function-call connection on the Diagnostics > Connectivity > Function calls pane in the Configuration Parameters dialog box to error or warning. This condition can lead to an error in the operation of the generated code.

Capabilities and Limitations

  • Does not run on library models.

  • Does not allow exclusions of blocks or charts.

See Also

Check the display attributes of block names

Check ID: mathworks.maab.jc_0061

Check the display attributes of subsystem and block names.

Description

When the subsystem and block names provide descriptive information, display the names. If the block function is known from its appearance, do not display the name. Blocks with names that are obvious from the block appearance:

  • From

  • Goto

  • Ground

  • Logic

  • MinMax

  • ModelReference

  • MultiPortSwitch

  • Product

  • Relational Operator

  • Saturate

  • Switch

  • Terminator

  • Trigonometry

  • Unit Delay

  • Sum

  • Compare To Constant

  • Compare To Zero

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action

Name is displayed and obvious from the block appearance.

Hide name by clearing Diagram > Format > Show Block Name.
Name is not descriptive. Specifically, the block name is:
  • Not obvious from the block appearance.

  • The default name appended with an integer.

Modify the name to be more descriptive or hide the name by clearing Diagram > Format > Show Block Name.
Name is descriptive and not displayed. Descriptive names are:
  • Provided for blocks that are not obvious from the block appearance.

  • Not a default name appended with an integer.

Display the name by selecting Diagram > Format > Show Block Name

Capabilities and Limitations

  • Runs on library models.

  • Analyzes content of library linked blocks.

  • Analyzes content in masked subsystems that have no workspaces and no dialogs.

  • Allows exclusions of blocks and charts.

See Also

Check display for port blocks

Check ID: mathworks.maab.jc_0081

Check the Icon display setting for Inport and Outport blocks.

Description

The Icon display setting is required.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
The Icon display setting is not set. Set the Icon display to Port number for the specified Inport and Outport blocks.

Capabilities and Limitations

  • Runs on library models.

  • Analyzes content of library linked blocks.

  • Analyzes content in masked subsystems that have no workspaces and no dialogs.

  • Allows exclusions of blocks and charts.

See Also

MAAB guideline, Version 3.0: jc_0081: Icon display for Port block in the Simulink documentation.

Check subsystem names

Check ID: mathworks.maab.jc_0201

Check whether subsystem block names include invalid characters.

Description

The names of all subsystem blocks that generate code are checked for invalid characters.

The check does not report invalid characters in subsystem names for:

  • Virtual subsystems

  • Atomic subsystems with Function Packaging set to Inline

Available with Simulink Verification and Validation.

Input Parameters

To control the naming convention for blocks that the check flags, you can use the Model Advisor Configuration Editor.

  1. Open the Model Configuration Editor and navigate to Check port block names. In the Input Parameter pane:

    • Use Naming standard to select MAAB 3.0 or Custom. When you select MAAB 3.0, the check uses the regular expression ([^a-zA-Z_0-9])|(^\d)|(^ )|(__)|(^_)|(_$) to verify that names:

      • Use these characters: a-z, A-Z, 0-9, and the underscore (_).

      • Do not start with a number.

      • Do not use underscores at the beginning or end of a string.

      • Do not use more than one consecutive underscore.

      When you select Custom, you can enter your own Regular expression for prohibited names. For example, if you want to allow more than one consecutive underscore, enter ([^a-zA-Z_0-9])|(^\d)|(^ )|(^_)|(_$).

  2. Click Apply.

  3. Save the configuration. When you run the check using this configuration, the check uses the input parameters that you specified.

Results and Recommended Actions

ConditionRecommended Action

The subsystem names do not comply with the naming standard specified in the input parameters.

Update the subsystem names to comply with your own guidelines or the MAAB guidelines.

Capabilities and Limitations

  • Runs on library models.

  • Analyzes content of library linked blocks.

  • Analyzes content in masked subsystems that have no workspaces and no dialogs.

  • Allows exclusions of blocks and charts.

Tips

Use underscores to separate parts of a subsystem name instead of spaces.

See Also

Check port block names

Check ID: mathworks.maab.jc_0211

Check whether Inport and Outport block names include invalid characters.

Description

The names of all Inport and Outport blocks are checked for invalid characters.

Available with Simulink Verification and Validation.

Input Parameters

To control the naming convention for blocks that the check flags, you can use the Model Advisor Configuration Editor.

  1. Open the Model Configuration Editor and navigate to Check port block names. In the Input Parameter pane:

    • Use Naming standard to select MAAB 3.0 or Custom. When you select MAAB 3.0, the check uses the regular expression ([^a-zA-Z_0-9])|(^\d)|(^ )|(__)|(^_)|(_$) to verify that names:

      • Use these characters: a-z, A-Z, 0-9, and the underscore (_).

      • Do not start with a number.

      • Do not use underscores at the beginning or end of a string.

      • Do not use more than one consecutive underscore.

      When you select Custom, you can enter your own Regular expression for prohibited names. For example, if you want to allow more than one consecutive underscore, enter ([^a-zA-Z_0-9])|(^\d)|(^ )|(^_)|(_$).

  2. Click Apply.

  3. Save the configuration. When you run the check using this configuration, the check uses the input parameters that you specified.

Results and Recommended Actions

ConditionRecommended Action

The block names do not comply with the naming standard specified in the input parameters.

Update the block names to comply with your own guidelines or the MAAB guidelines.

Capabilities and Limitations

  • Runs on library models.

  • Analyzes content of library linked blocks.

  • Analyzes content in masked subsystems that have no workspaces and no dialogs.

  • Allows exclusions of blocks and charts.

Tips

Use underscores to separate parts of a block name instead of spaces.

See Also

Check character usage in signal labels

Check ID: mathworks.maab.jc_0221

Check whether signal line names include invalid characters.

Description

The names of all signal lines are checked for invalid characters.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
The signal line name contains illegal characters. Rename the signal line. Allowed characters include a–z, A–Z, 0–9, underscore (_), and period (.).
The signal line name starts with a number. Rename the signal line.
The signal line name starts with an underscore ("_"). Rename the signal line.
The signal line name ends with an underscore ("_"). Rename the signal line.
The signal line name has consecutive underscores. Rename the signal line.
The signal line name has blank spaces. Rename the signal line.
The signal line name has control characters. Rename the signal line.

Capabilities and Limitations

  • Runs on library models.

  • Analyzes content of library linked blocks.

  • Analyzes content in masked subsystems that have no workspaces and no dialogs.

  • Does not allow exclusions of blocks or charts.

Tips

Use underscores to separate parts of a signal line name instead of spaces.

See Also

Check character usage in block names

Check ID: mathworks.maab.jc_0231

Check whether block names include invalid characters.

Description

The check reports invalid characters in all block names, except:

  • Inports and Outports

  • Unmasked subsystems

MAAB guideline, Version 3.0, jc_0231: Usable characters for block names does not apply to subsystem blocks.

Available with Simulink Verification and Validation.

Prerequisite

A prerequisite MAAB guideline, Version 3.0, for this check is jc_0201: Usable characters for Subsystem names.

Input Parameters

To control the naming convention for blocks that the check flags, you can use the Model Advisor Configuration Editor.

  1. Open the Model Configuration Editor and navigate to Check character usage in block names. In the Input Parameter pane:

    • Use Naming standard to select MAAB 3.0 or Custom. When you select MAAB 3.0, the check uses the regular expression ([^a-zA-Z_0-9\n\r ])|(^\d)|(^ ) to verify that names:

      • Use these characters: a-z, A-Z, 0-9, underscore (_), and blank space.

      • Do not start with a number or blank space.

      • Do not have double byte characters.

      When you select Custom, you can enter your own Regular expression for prohibited names. For example, if you do not want to allow underscores (_) in a block name, enter ([^a-zA-Z0-9\r])|(^\d)|(^ ).

  2. Click Apply.

  3. Save the configuration. When you run the check using this configuration, the check uses the input parameters that you specified.

Results and Recommended Actions

ConditionRecommended Action

The block names do not comply with the naming standard specified in the input parameters.

Update the block names to comply with your own guidelines or the MAAB guidelines.

Capabilities and Limitations

  • Runs on library models.

  • Analyzes content of library linked blocks.

  • Analyzes content in masked subsystems that have no workspaces and no dialogs.

  • Allows exclusions of blocks and charts.

Tips

Carriage returns are allowed in block names.

See Also

Check Trigger and Enable block names

Check ID: mathworks.maab.jc_0281

Check Trigger and Enable block port names.

Description

Block port names should match the name of the signal triggering the subsystem.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Trigger block does not match the name of the signal to which it is connected. Match Trigger block names to the connecting signal.
Enable block does not match the name of the signal to which it is connected. Match Enable block names to the connecting signal.

Capabilities and Limitations

  • JMAAB guideline, Version 4.0 limitation: This check only flags Trigger and Enable blocks names.

  • Runs on library models.

  • Analyzes content of library linked blocks.

  • Analyzes content in masked subsystems that have no workspaces and no dialogs.

  • Allows exclusions of blocks and charts.

See Also

Check for Simulink diagrams using nonstandard display attributes

Check ID: mathworks.maab.na_0004

Check model appearance setting attributes.

Description

Model appearance settings are required to conform to the guidelines when the model is released.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
The toolbar is not visible. Select View > Toolbar.
Wide Nonscalar Lines is cleared. Select Display > Signals & Ports > Wide Nonscalar Lines.
Viewer Indicators is cleared. Select Display > Signals & Ports > Viewer Indicators.
Testpoint Indicators is cleared. Select Display > Signals & Ports > Testpoint & Logging Indicators.
Port Data Types is selected. Clear Display > Signals & Ports > Port Data Types.
Storage Class is selected. Clear Display > Signals & Ports > Storage Class.
Signal Dimensions is selected. Clear Display > Signals & Ports > Signal Dimensions.
Model Browser is selected. Clear View > Model Browser > Show Model Browser.
Sorted Execution Order is selected. Clear Display > Blocks > Sorted Execution Order.
Model Block Version is selected. Clear Display > Blocks > Block Version for Referenced Models.
Model Block I/O Mismatch is selected. Clear Display > Blocks > Block I/O Mismatch for Referenced Models.
Library Links is set to Disabled, User Defined or All. Select Display > Library Links > None.
Linearization Indicators is cleared. Select Display > Signals & Ports > Linearization Indicators.
Block backgrounds are not white. Blocks should have black foregrounds with white backgrounds. Click the specified block and select Format > Foreground Color > Black and Format > Background Color > White.
Diagrams do not have white backgrounds. Select Diagram > Format > Canvas Color > White.
Diagrams do not have zoom factor set to 100%. Select View > Zoom > Normal (100%).

Action Results

Clicking Modify updates the display attributes to conform to the guideline.

Capabilities and Limitations

  • Does not run on library models.

  • Analyzes content of library linked blocks.

  • Analyzes content in masked subsystems that have no workspaces and no dialogs.

  • Does not allow exclusions of blocks or charts.

See Also

Check MATLAB code for global variables

Check ID: mathworks.maab.na_0024

Check for global variables in MATLAB code.

Description

Verifies that global variables are not used in any of the following:

  • MATLAB code in MATLAB Function blocks

  • MATLAB functions defined in Stateflow charts

  • Called MATLAB functions

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Global variables are used in one or more of the following:
  • MATLAB code in MATLAB Function blocks

  • MATLAB functions defined in Stateflow charts

  • Called MATLAB functions

Replace global variables with signal lines, function arguments, or persistent data.

Capabilities and Limitations

  • Runs on library models.

  • Does not analyze content of library linked blocks.

  • Analyzes content in all masked subsystems.

  • Does not allow exclusions of blocks or charts.

See Also

MAAB guideline, Version 3.0: na_0024: Global Variables in the Simulink documentation.

  • MAAB guideline, Version 3.0: na_0024: Global Variables in the Simulink documentation.

  • JMAAB guideline, Version 4.0: na_0024: Global variable.

Check visibility of block port names

Check ID: mathworks.maab.na_0005

Check the visibility of port block names.

Description

An organization applying the MAAB guideline, Version 3.0, must select one of the following alternatives to enforce:

  • The names of port blocks are not hidden.

  • The name of port blocks must be hidden.

Available with Simulink Verification and Validation.

Input Parameters

All Port names should be shown (Format/Show Name)

Select this check box if all ports should show the name, including subsystems.

Results and Recommended Actions

ConditionRecommended Action
Blocks do not show their name and the All Port names should be shown (Format/Show Name) check box is selected. Change the format of the specified blocks to show names according to the input requirement.
Blocks show their name and the All Port names should be shown (Format/Show Name) check box is cleared. Change the format of the specified blocks to hide names according to the input requirement.
Subsystem blocks do not show their port names. Set the subsystem parameter Show port labels to a value other than none.
Subsystem blocks show their port names. Set the subsystem parameter Show port labels to none.

Capabilities and Limitations

  • Runs on library models.

  • Does not analyze content in masked subsystems.

  • Analyzes content in masked subsystems that have no workspaces and no dialogs.

  • Allows exclusions of blocks and charts.

See Also

MAAB guideline, Version 3.0: na_0005: Port block name visibility in Simulink models in the Simulink documentation.

Check orientation of Subsystem blocks

Check ID: mathworks.maab.jc_0111

Check the orientation of subsystem blocks.

Description

Subsystem inputs must be located on the left side of the block, and outputs must be located on the right side of the block.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Subsystem blocks are not using the right orientationRotate the subsystem so that inputs are on the left side of block and outputs are on the right side of the block.

Capabilities and Limitations

  • JMAAB guideline, Version 4.0 limitation: The check does not flag the rotation of subsystems.

  • Runs on library models.

  • Analyzes content of library linked blocks.

  • Analyzes content in masked subsystems that have no workspaces and no dialogs.

  • Allows exclusions of blocks and charts.

See Also

Check usage of Relational Operator blocks

Check ID: mathworks.maab.jc_0131

Check the position of Constant blocks used in Relational Operator blocks.

Description

When the relational operator is used to compare a signal to a constant value, the constant input should be the second, lower input.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Relational Operator blocks have a Constant block on the first, upper input. Move the Constant block to the second, lower input.

Capabilities and Limitations

  • Runs on library models.

  • Analyzes content of library linked blocks.

  • Analyzes content in masked subsystems that have no workspaces and no dialogs.

  • Allows exclusions of blocks and charts.

See Also

Check usage of Switch blocks

Check ID: mathworks.maab.jc_0141

Check usage of Switch blocks.

Description

Verifies that the Switch block control input (the second input) is a Boolean value and that the block is configured to pass the first input when the control input is nonzero.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
The Switch block control input (second input) is not a Boolean value.Change the data type of the control input to Boolean.
The Switch block is not configured to pass the first input when the control input is nonzero. Set the block parameter Criteria for passing first input to u2 ~=0.

Capabilities and Limitations

  • Does not run on library models.

  • Analyzes content of library linked blocks.

  • Analyzes content in masked subsystems that have no workspaces and no dialogs.

  • Allows exclusions of blocks and charts.

See Also

Check usage of buses and Mux blocks

Check ID: mathworks.maab.na_0010

Check usage of buses and Mux blocks.

Description

This check verifies the usage of buses and Mux blocks.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
The individual scalar input signals for a Mux block do not have common functionality, data types, dimensions, and units.Modify the scalar input signals such that the specifications match.
The output of a Mux block is not a vector.Change the output of the Mux block to a vector.
All inputs to a Mux block are not scalars.Make sure that all input signals to Mux blocks are scalars.
The input for a Bus Selector block is not a bus signal.Make sure that the input for all Bus Selector blocks is a bus signal.

Capabilities and Limitations

  • Does not run on library models.

  • Does not allow exclusions of blocks or charts.

See Also

Check for bitwise operations in Stateflow charts

Check ID: mathworks.maab.na_0001

Identify bitwise operators (&, |, and ^) in Stateflow charts. If you select Enable C-bit operations for a chart, only bitwise operators in expressions containing Boolean data types are reported. Otherwise, all bitwise operators are reported for the chart.

Description

Do not use bitwise operators in Stateflow charts, unless you enable bitwise operations.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Stateflow charts with Enable C-bit operations selected use bitwise operators (&, |, and ^) in expressions containing Boolean data types.Do not use Boolean data types in the specified expressions.
The Model Advisor could not determine the data types in expressions with bitwise operations.To allow Model Advisor to determine the data types, consider explicitly typecasting the specified expressions.
Stateflow charts with Enable C-bit operations cleared use bitwise operators (&, |, and ^).To fix this issue, do either of the following:
  • Modify the expressions to replace bitwise operators.

  • If not using Boolean data types, consider enabling bitwise operations. In the Chart properties dialog box, select Enable C-bit operations.

Capabilities and Limitations

  • Applies only to charts that use C as the action language.

  • Does not run on library models.

  • Does not analyze content of library linked blocks.

  • Analyzes content in all masked subsystems.

  • Allows exclusions of blocks and charts.

See Also

Check for comparison operations in Stateflow charts

Check ID: mathworks.maab.na_0013

Identify comparison operations with different data types in Stateflow objects.

Description

Comparisons should be made between variables of the same data types.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Comparison operations with different data types were found.Revisit the specified operations to avoid comparison operations with different data types.
The Model Advisor could not determine the data types in expressions with comparison operations.To allow Model Advisor to determine the data types, consider explicitly typecasting the specified expressions.

Capabilities and Limitations

  • Does not run on library models.

  • Does not analyze content of library linked blocks.

  • Analyzes content in all masked subsystems.

  • Allows exclusions of blocks and charts.

See Also

Check for unary minus operations on unsigned integers in Stateflow charts

Check ID: mathworks.maab.jc_0451

Identify unary minus operations applied to unsigned integers in Stateflow objects.

Description

Do not perform unary minus operations on unsigned integers in Stateflow objects.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Unary minus operations are applied to unsigned integers in Stateflow objects.Modify the specified objects to remove dependency on unary minus operations.
The Model Advisor could not determine the data types in expressions with unary minus operations.To allow Model Advisor to determine the data types, consider explicitly typecasting the specified expressions.

Capabilities and Limitations

  • Does not run on library models.

  • Does not analyze content of library linked blocks.

  • Analyzes content in all masked subsystems.

  • Allows exclusions of blocks and charts.

See Also

Check for equality operations between floating-point expressions in Stateflow charts

Check ID: mathworks.maab.jc_0481

Identify equal to operations (==) in expressions where at least one side of the expression is a floating-point variable or constant.

Description

Do not use equal to operations with floating-point data types. You can use equal to operations with integer data types.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Expressions use equal to operations (==) where at least one side of the expression is a floating-point variable or constant.Modify the specified expressions to avoid equal to operations between floating-point expressions. If an equal to operation is required, a margin of error should be defined and used in the operation.
The Model Advisor could not determine the data types in expressions with equality operations.To allow Model Advisor to determine the data types, consider explicitly typecasting the specified expressions.

Capabilities and Limitations

  • Does not run on library models.

  • Does not analyze content of library linked blocks.

  • Analyzes content in all masked subsystems.

  • Allows exclusions of blocks and charts.

See Also

MAAB guideline, Version 3.0: jc_0481: Use of hard equality comparisons for floating point numbers in Stateflow in the Simulink documentation.

Check input and output settings of MATLAB Functions

Check ID: mathworks.maab.na_0034

Identify MATLAB Functions that have inputs, outputs or parameters with inherited complexity or data type properties.

Description

The check identifies MATLAB Functions with inherited complexity or data type properties. A results table provides links to MATLAB Functions that do not pass the check, along with conditions triggering the warning.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
MATLAB Functions have inherited interfaces.

Explicitly define complexity and data type properties for inports, outports, and parameters of MATLAB Function identified in the results.

If applicable, using the MATLAB Function Block Editor, make the following modifications in the Ports and Data Manager:

  • Change Complexity from Inherited to On or Off.

  • Change Type from Inherit: Same as Simulink to an explicit type.

  • Change Size from —1 (Inherited) to an explicit size.

Capabilities and Limitations

  • Runs on library models.

  • Does not analyze content of library linked blocks.

  • Analyzes content in all masked subsystems.

  • Allows exclusions of blocks and charts.

See Also

Check MATLAB Function metrics

Check ID: mathworks.maab.himl_0003

Display complexity and code metrics for MATLAB Functions. Report metric violations.

Description

This check provides complexity and code metrics for MATLAB Functions. The check additionally reports metric violations.

A results table provides links to MATLAB Functions that violate the complexity input parameters.

Available with Simulink Verification and Validation.

Input Parameters

Maximum effective lines of code per function

Provide the maximum effective lines of code per function. Effective lines do not include empty lines, comment lines, or lines with a function end keyword.

Minimum density of comments

Provide minimum density of comments. Density is ratio of comment lines to total lines of code.

Maximum cyclomatic complexity per function

Provide maximum cyclomatic complexity per function. Cyclomatic complexity is the number of linearly independent paths through the source code.

Results and Recommended Actions

ConditionRecommended Action
MATLAB Function violates the complexity input parameters.For the MATLAB Function:
  • If effective lines of code is too high, further divide the MATLAB Function.

  • If comment density is too low, add comment lines.

  • If cyclomatic complexity per function is too high, further divide the MATLAB Function.

Capabilities and Limitations

  • Runs on library models.

  • Does not analyze content of library linked blocks.

  • Analyzes content in all masked subsystems.

  • Allows exclusions of blocks and charts.

See Also

Check for mismatches between names of Stateflow ports and associated signals

Check ID: mathworks.maab.db_0123

Check for mismatches between Stateflow ports and associated signal names.

Description

The name of Stateflow input and output should be the same as the corresponding signal. The check does not flag name mismatches for reusable Stateflow charts in libraries.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
Signals have names that differ from the corresponding Stateflow ports. Change the names of either the signals or the Stateflow ports.

Capabilities and Limitations

  • Does not run on library models.

  • Analyzes content of library linked blocks.

  • Analyzes content in all masked subsystems.

  • Allows exclusions of blocks and charts. Exclusions will not work for library linked charts.

See Also

  • MAAB guideline, Version 3.0: db_0123: Stateflow port names in the Simulink documentation.

  • JMAAB guideline, Version 4.0: db_0123: Stateflow port names.

Check scope of From and Goto blocks

Check ID: mathworks.maab.na_0011

Check the scope of From and Goto blocks.

Description

You can use global scope for controlling flow. However, From and Goto blocks must use local scope for signal flows.

Available with Simulink Verification and Validation.

Results and Recommended Actions

ConditionRecommended Action
From and Goto blocks are not configured with local scope.
  • Make sure that the ports are connected.

  • Change the scope of the specified blocks to local.

Capabilities and Limitations

  • Does not run on library models.

  • Analyzes content of library linked blocks.

  • Analyzes content in all masked subsystems.

  • Allows exclusions of blocks and charts.

See Also

Was this topic helpful?