This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

MathWorks Automotive Advisory Board Checks

MathWorks Automotive Advisory Board Checks

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

The Model Advisor performs a checkout of the Simulink® Check™ 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. To specify font rules for a Simulink session, from the Simulink editor select Diagram > Format > Font Styles for Model.

Available with Simulink Check.

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 in the right pane of the Model Advisor, 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

  • JMAAB guideline, Version 5.1 limitations:

    • The check does not flag Stateflow state labels and box name font and font style settings. (Sub ID: c)

    • The check does not flag Stateflow state labels and box name font size settings. (Sub ID: d)

  • 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

In the right pane of the Model Advisor, 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.

  • Junctions in flow charts should have a default exit transition.

  • Transitions in flow charts should not combine condition and action.

Available with Simulink Check.

This check requires a Stateflow® license.

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.
Junction does not have a default exit transitionAdd a default exit transition to the junction.
Transition has condition and actionSplit up condition and action into separate transitions

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

Edit-Time Checking.  This check is supported by edit-time checking.

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. To automatically fix warnings associated with this check, see Automatically Fix Display of Nondefault Block Parameters.

To customize the list of nondefault block parameters that are flagged by the check, see Customize Model Advisor Check for Nondefault Block Attributes.

Available with Simulink Check.

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 box, use the Block Annotation tab to add block parameter annotations.

Capabilities and Limitations

  • Only customizable for block parameters in IntrinsicDialogParameters. See Common Block Properties (Simulink)

  • JMAAB guideline, Version 5.1 limitation: The check flags masked blocks that display parameter information but do not use block annotations. JMAAB 5.1 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 dialog boxes.

  • 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 by using Simulink.

See Also

Check usage of merge blocks

Check ID: mathworks.maab.na_0032

Check usage of Merge blocks.

Description

Identifies instances where buses are not identical in the Merge block, including number of elements, element names, element order, element data type, and element size.

Note

These Merge block constraints are not covered by this check. They are flagged via compile-time errors.

  • Signals and buses entering the Merge block cannot branch off to other blocks.

  • Buses must be either all virtual or all nonvirtual.

Available with Simulink Check.

Results and Recommended Actions

ConditionRecommended Action
Block parameter Allow unequal port widths is selected.Clear block parameter Allow unequal port widths/
Elements for bus input to a Merge block are different. Bus input to a Merge block must be equivalent, including the same hierarchy with identical names and attributes for all elements. Consider updating the elements so that all buses are identical.
Data types for input signals to a Merge block are different. The Merge block accepts real or complex signals of any data type that Simulink supports, including fixed-point and enumerated data types. Inputs must be of the same data type and numeric type. Consider updating the signals so data types are the same.
Dimensions of input signals to a Merge block are different. The Merge block accepts only inputs of equal dimensions. Consider updating the signals inputs so they have the same dimensions.
Unequal number of inputs on the Merge block.Connect a Merge block to at least two input signals and verify that input signals have the same sample time. Consider making the number of inputs signal and input ports the same.

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 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 Selector block (tool forces labeling)

    • Chart block (Stateflow)

    • Data Store Write block

    • Goto block

    • Mux block

    • Outport block

    • Subsystem block

  • Any signal of interest.

Available with Simulink Check.

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.Label the signal.

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

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. There should be only one default transition.

Available with Simulink Check.

This check requires a Stateflow license.

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

  • JMAAB guideline, Version 5.1 limitations:

    • The check does not detect default transitions that exceed the state boundary.

    • The check does not detect missing unconditional default transitions.

    • The check does not detect the horizontal placement (left position) of the default transition.

  • 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 in Stateflow graphical functions

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

This check requires a Stateflow license.

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

This check requires a Stateflow license.

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.

Edit-Time Checking.  This check is supported by edit-time checking.

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 Stateflow graphical functions

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

This check requires a Stateflow license.

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

This check requires a Stateflow license.

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 5.1: 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 Check.

This check requires a Stateflow license.

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

  • JMAAB guideline, Version 5.1 limitation: The check cannot be configured to flag event used other than a Stateflow chart output. (Sub ID: a1)

  • 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 Check.

This check requires a Stateflow license.

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.

Edit-Time Checking.  This check is supported by edit-time checking.

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

This check requires a Stateflow license.

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.

Edit-Time Checking.  This check is supported by edit-time checking.

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

This check requires a Stateflow license.

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

  • JMAAB guideline, Version 5.1 limitation: This check cannot be configured to support one-based indexing. (Sub ID: a2)

  • 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 5.1: db_0112: Usage of index

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

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

  • JMAAB guideline, Version 5.1 limitations:

    • The check does not flag conflicts with MATLAB reserved keywords. (Sub ID: f)

    • The check does not flag identical file names on the MATLAB path. (Sub ID: g)

  • 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 5.1: ar_0001: Usable characters for file names

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

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

  • JMAAB guideline, Version 5.1 limitation: The check does not flag conflicts with MATLAB reserved keywords. (Sub ID: f)

  • Runs on library models.

  • Does not allow exclusions of blocks or charts.

  • Analyzes the full path of the model.

  • Analyzes subdirectories in the same directory as the model.

See Also

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

  • JMAAB guideline, Version 5.1: 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 Check.

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

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.

Edit-Time Checking.  This check is supported by edit-time checking.

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

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.

Edit-Time Checking.  This check is supported by edit-time checking.

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. It is acceptable to move the Inport block to the right only to prevent signal crossings.

  • Place Outport blocks on the right side of the diagram. It is acceptable to move the Outport block to the 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 Check.

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

  • JMAAB guideline, Version 5.1 limitations:

    • The check does not flag when Inports are not placed on the left side of the diagram. (Sub ID: a)

    • The check does not flag when Outports are not placed on the right side of the diagram. (Sub ID: b)

  • Runs on library models.

  • Analyzes content of library linked blocks.

  • Analyzes content in all masked subsystems.

  • Allows exclusions of blocks and charts.

  • Does not analyze signal crossings

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

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

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.

Edit-Time Checking.  This check is supported by edit-time checking.

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

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

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

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.
For Each, For Iterator, and While Iterator blocks are not in the same location on the subsystem diagram.Move the For Each, For Iterator, and While Iterator blocks so they are at a uniform location on the subsystem diagram.

Capabilities and Limitations

  • JMAAB guideline, Version 5.1 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

Supported blocks include:

Available with Simulink Check.

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

This check flags Stateflow data whose local scope is not defined at the Chart level or below, regardless of whether the data is used or not.

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

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 5.1 limitations:

    • The check does not flag Constant local data defined at the machine level. (Sub ID: b)

    • The check does not flag duplicate data definition and usage within a parent-child relationships. (Sub ID: c)

    • The check does not flag Parameter local data defined at the machine level. (Sub ID: d)

    • 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 Check.

This check requires a Stateflow license.

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.

  • Analyzes content of library linked blocks and charts.

  • 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 Check.

This check requires a Stateflow license.

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

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.

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

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

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

Input Parameters.  To specify the custom blocks and masks to include in this check, use the Model Advisor Configuration Editor.

  1. Open the Model Configuration Editor and navigate to Check the display attributes of block names. In the Input Parameters pane, select Custom.

  2. Use the Block type list table to include or exclude blocks and masks from the check.

  3. Click Apply.

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

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
Check does not evaluate my custom blocks and masks.Use the Model Configuration Editor to specify your custom checks and 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

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

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.

Edit-Time Checking.  This check is supported by edit-time checking.

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

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

  • JMAAB guideline, Version 5.1 limitation: The check does not flag conflicts with MATLAB reserved keywords. (Sub ID: f)

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

Edit-Time Checking.  This check is supported by edit-time checking.

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

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

  • JMAAB guideline, Version 5.1 limitation: The check does not flag conflicts with MATLAB reserved keywords. (Sub ID: f)

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

Edit-Time Checking.  This check is supported by edit-time checking.

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

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, and underscore (_).
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 Simulink bus signal names

Check ID: mathworks.maab.na_0030

Checks Simulink bus signal names.

Description

This check verifies that Simulink bus signal names comply with your own modeling guidelines or MAAB modeling guideline na_0030. MAAB naming guidelines are as follows.

Form

Simulink bus signal names:

  • Should not start with a number

  • Should not have blank spaces

  • Carriage returns are not allowed

Allowed Characters

Simulink bus signal names can contain characters:
a b c d e f g h i j k l m n o p q r s t u v w x y z
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
0 1 2 3 4 5 6 7 8 9 _

Underscores

Simulink bus signal names:

  • Can use underscores to separate parts

  • Cannot have more than one consecutive underscore

  • Cannot start with an underscore

  • Cannot end with an underscore

Available with Simulink Check.

Input Parameters

To specify the naming standard for Simulink bus signal names, use the Model Advisor Configuration Editor.

  1. Open the Model Configuration Editor and navigate to Check Simulink bus signal names. In the Input Parameters pane, enter:

    • MAAB 3.0 to use the MAAB naming standard. 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.

    • Custom to use your own naming standard. 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 Simulink bus signal names do not comply with the naming standard specified in the input parameters.Update the Simulink bus signal names to comply with your own or the MAAB guidelines.

Capabilities and Limitations

  • Analyzes content in all masked subsystems.

  • Allows exclusions of blocks and charts.

  • Allows syntax highlighting.

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

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

  • JMAAB guideline, Version 5.1 limitations:

    • The check does not flag the Basic block names, apart from [Inport] and [Outport], that use underscores at the beginning. (Sub ID: a)

    • The check does not flag the Basic block names, apart from [Inport] and [Outport], that use underscores at the end. (Sub ID: b)

    • The check does not flag the Basic block names, apart from [Inport] and [Outport], that use consecutive underscores. (Sub ID: c)

    • The check does not flag the Basic block names, apart from [Inport] and [Outport], that solely consists of a single reserved MATLAB word. (Sub ID: d)

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

Edit-Time Checking.  This check is supported by edit-time checking.

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. The check does not flag Trigger or Enable block names if the associated signal does not have a label.

Available with Simulink Check.

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 5.1 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 Check.

Results and Recommended Actions

ConditionRecommended Action
The toolbar is not visible. Select View > Toolbar.
The status bar is not visible. Select View > Status Bar.
Sample Time > Colors is selected. Clear Sample Time > Colors.
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.
Execution Context Indicator is selected. Clear Display > Signals & Ports > Execution Context Indicator.
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 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. Select Format > Background Color > White.
Block foregrounds are not black.Select Format > Foreground Color > Black.
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 Check.

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.

  • JMAAB guideline, Version 5.1: na_0024: Shared data in MATLAB functions

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.

When the check is configured to display all port names, the check do not flag the port names that are hidden due to the Hide Automatic Names feature in Simulink.

Available with Simulink Check.

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

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

Edit-Time Checking.  This check is supported by edit-time checking.

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

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

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.

Edit-Time Checking.  This check is supported by edit-time checking. However, edit-time checking for this check does not verify that the data type of the control input is a Boolean value.

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

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

  • JMAAB guideline, Version 5.1 limitation: The check does not flag when blocks other than Demux and Mux are used to generate or decompose a vector. For example, a Selector block used instead of Demux or a Vector Concatenate used instead of Mux block. (Sub ID: a)

  • Does not run on library models.

  • Does not allow exclusions of blocks or charts.

  • Does not flag non-scalar inputs as described in MAAB guideline na_0010: Grouping data flows into signals.

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

This check requires a Stateflow license.

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

  • JMAAB guideline, Version 5.1 limitations:

    • The check does not flag when operators other than "!" are used for logical negation. (Sub ID: a)

    • The check cannot be configured to select between "~=", "!=", and "<>" for inequality operations. (Sub ID: b1, b2, b3)

    • The check does not detect when the "^" and "~" bitwise operators are used for Boolean operations. (Sub ID: c)

  • 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 fundamental logical and numerical operations

Check ID: mathworks.maab.na_0002

Checks data types in numerical and logic blocks.

Description

Checks the data types for logical and numerical blocks and identifies when the data type does is not appropriate for the operation.

The data type for logical blocks should be Boolean. Logic blocks include:

The data type for numerical blocks should be non-boolean. Numerical blocks include:

Available with Simulink Check.

Input Parameters

To specify the custom blocks and masks to include in this check, use the Model Advisor Configuration Editor.

  1. Open the Model Configuration Editor and navigate to Check fundamental logical and numerical operations. In the Input Parameters pane, select Custom.

  2. Use the Blocks for Numerical Operations and Blocks for Logical Operations tables to include or exclude blocks and masks from the check.

  3. Click Apply.

  4. 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
Data type for a numerical block is Boolean.Consider changing the data type to a non-boolean.
Data type for a logical block is not Boolean.Consider changing the data type to a Boolean.
Check does not evaluate my custom blocks and masks.Enter your custom blocks and masks using the input parameters in the Model Configuration Editor.

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 logical expressions in If blocks

Check ID: mathworks.maab.na_0003

Check If blocks for inappropriate construct of primary expressions in a logical expression.

Description

Identifies instances in an If block where primary expressions are complex.

Primary expressions are defined as:

  • An input

  • A constant

  • A constant parameter

  • A parenthesized expression containing no operators other than zero or <, >, >=, <=, ==, ~=, |, &, and ~

Examples of primary expressions include:

  • u1

  • 5

  • K

  • (u1 > 0)

  • (u1 <= G)

  • (u1 > U2)

  • (~u1)

Examples of acceptable logical expressions exceptions include:

  • u1 | u2

  • ((u1 > 0) & (u1 < 20)

  • (u1 > 0) & (u2 < u3)

  • (u1 > 0) & (~u2)

This table provides examples of unacceptable logical expressions.

Primary ExpressionReasoning

u1 & u2 | u3

Too many primary expressions.

u1 & (u2 | u3)

Unacceptable operator within primary expression.

(u1 > 0) & (u1 < 20) & (u2 > 5)

Too many primary expressions that are not inputs.

(u1 > 0) & ((2* u2) > 6)

Unacceptable operator within primary expression.

Exception

A logical expression can contain more than two primary expressions when both these conditions are met:

  • The primary expressions are all inputs.

  • Only one type of logical operator is present.

Examples of acceptable exceptions include:

  • u1 | u2 | u3 | u4 | u5

  • u1 & u2 & u3 & u4

Simple "If" Expressions

In the literal interpretation of guideline na_0003, expression u1 < u2 is a violation. However, the expression follows the commonly used "If" expression template (<Primary Expression><Operator><Primary Expression>). So, when logical operators are not used and only one relational operator is present, the expression satisfies guideline na_0003 and u1 < u2 is NOT a violation.

Available with Simulink Check.

Results and Recommended Actions

ConditionRecommended Action
Logical expression contains more than two primary expressions that consist of a constant, constant parameter, and input.

Consider one of the following:

  • Make primary expressions an input and either:

    • Use parenthesized expressions with one relational operator type

    • Construct a simple "If" express using template
      <Primary Expression><Logical Operator><Primary Expression>

  • Reduce the number of primary expressions to two or less.

  • Construct the logical expression using logical blocks other than the If block.

Logical expression contains more than two parenthesized expressions that use multiple relational operators

Consider one of the following:

  • Use only one type of relational operator. Acceptable logical operators include <, >, >=, <=, ==, ~=, |, &, and ~. The primary expression must consist of inputs only.

  • Reduce the number of parenthesized expressions to two or less.

  • Construct the logical expression using logical blocks other than the If block.

Parenthesized expression includes a relational operator other than zero or <, >, >=, <=, ==, ~=, |, &, or ~.

Consider one of the following:

  • Use relational operator <, >, >=, <=, ==, ~=, |, &, or ~ within the parenthesized expression.

  • Construct the logical expression using logical blocks other than the If block.

Capabilities and Limitations

  • Does not flag logical expressions that use only one of these relative operators <, >, >=, <=, ==, ~=, |, &, and ~

  • Runs on library models.

  • Analyzes content of library linked blocks.

  • Analyzes content in all masked subsystems.

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

This check requires a Stateflow license.

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 usage of restricted variable names

Check ID: mathworks.maab.na_0019

Check for use of reserved keywords in MATLAB Function block variable names.

Description

Identifies variable names in MATLAB Function blocks that conflict with reserved C and C++ keywords. For a complete list of reserved keywords, see Reserved Keywords (Simulink Coder).

Avoid using variable names that conflict with MATLAB Functions, such as conv.

This check is case insensitive. For example, the check flags keywords true, True, TRUE, and tRue.

Available with Simulink Check.

Results and Recommended Actions

ConditionRecommended Action
Variable name conflicts with reserved keyword.Consider using a different variable name that does not conflict with the reserved keywords.

Capabilities and Limitations

  • Runs on library models.

  • Analyzes content of library linked blocks.

  • Analyzes content in all masked subsystems.

See Also

Check unused ports in Variant Subsystems

Check ID: mathworks.maab.na_0020

Checks variant subsystems for unused ports.

Description

Checks variant subsystems for unused ports and provides the action to terminate the unused inputs with a Terminator block.

Results and Recommended Actions

ConditionRecommended Action
Variant subsystem has unused ports Consider connecting the unused ports to Terminator blocks.

Check action connects unused ports to Terminator blocks.

Available with Simulink Check.

Capabilities and Limitations

  • JMAAB guideline, Version 5.1 limitations:

    • The check does not flag when the number of inputs to the subordinate subsystem are different. (Sub ID: a)

    • The check does not flag when the number of inputs to the subordinate model are different. (Sub ID: b)

  • Runs on library models.

  • Analyzes content of library linked blocks.

  • Analyzes content in all masked subsystems.

  • Allows exclusions of blocks and charts.

  • Allows syntax highlighting.

See Also

Check usage of character vector inside MATLAB Function block

Check ID: mathworks.maab.na_0021

Check for use of character vectors in MATLAB Function blocks.

Description

Identifies character vectors that are used in MATLAB Function blocks.

MATLAB Functions store strings as character arrays. Due to lack of dynamic memory allocation, the arrays cannot be re-sized to accommodate a string value of different length. Strings are not a supported data type in Simulink, so MATLAB Function blocks cannot pass the string data outside the block.

Available with Simulink Check.

Results and Recommended Actions

ConditionRecommended Action
MATLAB Function block contains a character vector.Consider using enumerations instead of character vectors.

Capabilities and Limitations

  • Does not flag strings in MATLAB

  • Does not flag character vectors that are hard-coded into the class definition.

  • Runs on library models.

  • Analyzes content of library linked blocks.

  • Analyzes content in all masked subsystems.

See Also

Check usage of recommended patterns for Switch/Case statements

Check ID: mathworks.maab.na_0022

Check for use of non-constant variables in Switch/Case statements.

Description

In generated code, MATLAB Function block inputs are passed as functional arguments. This check evaluates the Switch/Case statements in the generated code to determine if non-constant values are being used in the Case argument.

Available with Simulink Check.

Results and Recommended Actions

ConditionRecommended Action
Non-constant variables are used in the Switch/Case statement.Consider defining the input variable as a constant.

Capabilities and Limitations

  • Runs on library models.

  • Analyzes content of library linked blocks.

  • Analyzes content in all masked subsystems.

See Also

Check use of default variants

Check ID: mathworks.maab.na_0036

Check use of default variants in a variant subsystem.

Description

Checks Variant Subsystem, Variant Source, Variant Sink, and variant Model blocks in a variant subsystem for a default variant.

Available with Simulink Check.

Input Parameters

To set the active variant as the default variant, use the Model Advisor Configuration Editor.

  1. Open the Model Configuration Editor and navigate to Check use of default variants. In the Input Parameters pane, select Check use of 'Allow zero active variant controls' option.

    Note

    When using Allow zero active variant controls option, set the following on output ports of the variant subsystem:

    • Set Specify output when source is unconnected to true

    • Provide a valid value in Constant value

    • Set Output Data type to Inherit: auto

  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 does not contain a default variant.

Set block parameter Variant control to (default)

Block parameter Variant Control is set to Variant.

To set the active variant as the default variant.

  1. Variant Control is set to Variant

  2. Open the variant block and select block parameter Allow zero active variant controls.

  3. For output ports of the variant subsystem:

    • Set Specify output when source is unconnected to true

    • Provide a valid value in Constant value

    • Set Output Data type to Inherit: auto

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

  • Allows syntax highlighting

See Also

Check use of single variable variant conditionals

Check ID: mathworks.maab.na_0037

Check use of single variables in conditional expressions

Description

Checks Variant Subsystem, Variant Source, Variant Sink, and variant Model blocks for conditional expressions that have more than one variable.

Note

Guideline na_0037 states that default variants are an exception to the recommendation of writing variant conditional expressions using multiple variable with a single condition. You can define a default by:

  • Selecting (default) in the block parameter Variant control.

  • Specifying an exhaustive condition.

This check cannot differentiate between defaults that are defined using an exhaustive condition.

Available with Simulink Check.

Results and Recommended Actions

ConditionRecommended Action
Conditional expression contains more than one condition variable.Consider updating your model so that only one variant is used.

Conditional expression variable or Simulink.Variant object is not found in the workspace.

Consider defining a variant in your model.
Check does not execute on my variant subsystem. Clear Override variant conditions and use following variant for the variant subsystem.

Capabilities and Limitations

  • Does not check default variants.

  • Does not run on the Variant subsystem when you select Override variant conditions and use following variant

  • Runs on library models.

  • Analyzes content of library linked blocks.

  • Analyzes content in all masked subsystems.

See Also

Check nested states in Stateflow charts

Check ID: mathworks.maab.na_0038

Checks the depth of nested states in Stateflow charts.

Description

Checks the depth of nested states inStateflow charts and identifies states that exceed the defined nesting level threshold.

MAAB guideline na_0038 recommends three levels.

Available with Simulink Check.

Input Parameters

To specify the threshold for nesting levels of Stateflow states, use the Model Advisor Configuration Editor.

  1. Open the Model Configuration Editor and navigate to Check nested states in Stateflow charts.

  2. In the Input Parameters pane, enter the nesting level threshold. The default value is 3.

  3. Click Apply.

  4. 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
Level of nested Stateflow states exceeds the defined threshold.Consider encapsulating Stateflow states in subcharts so level of nested states does not exceed the threshold.

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.

  • Allows syntax highlighting.

See Also

Check use of Simulink in Stateflow charts

Check ID: mathworks.maab.na_0039

Checks for Stateflow charts that are nested in Simulink functions used in the root Stateflow chart.

Description

Checks Simulink functions in the root Stateflow chart and identifies Stateflow charts that are nested within these functions.

Available with Simulink Check.

Results and Recommended Actions

ConditionRecommended Action
The Simulink function has a nested Stateflow chart.Consider modifying your root Stateflow chart so the Simulink function does not contain a nested Stateflow chart.

Capabilities and Limitations

  • Does not check Stateflow states.

  • Runs on library models.

  • Analyzes content of library linked blocks.

  • Analyzes content in all masked subsystems.

  • Allows exclusions of blocks and charts.

  • Allows syntax highlighting.

See Also

Check number of Stateflow states per container

Check ID: mathworks.maab.na_0040

Checks the number of viewable states within a Stateflow container.

Description

Checks the number of viewable states in a Stateflow container and identifies containers that exceed the defined threshold. A state is considered visible if it is not within an atomic subchart, function, or subchart.

MAAB guideline na_0040 recommends six to 10 states per container.

Available with Simulink Check.

Input Parameters

To specify the threshold for the number of viewable states in a Stateflow container, use the Model Advisor Configuration Editor.

  1. Open the Model Configuration Editor and navigate to Check number of Stateflow states per container.

  2. In the Input Parameters pane, enter the threshold for the number of viewable states per container. The default value is 10.

  3. Click Apply.

  4. 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
Number of viewable states in the Stateflow container exceeds the defined threshold.Consider encapsulating Stateflow states in subcharts so the number of states per container does not exceed the threshold.

Capabilities and Limitations

  • Atomic subcharts are considered as states and included in the check.

  • Runs on library models.

  • Analyzes content of library linked blocks.

  • Analyzes content in all masked subsystems.

  • Allows exclusions of blocks and charts.

  • Allows syntax highlighting.

See Also

Check usage of unary minus operations 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 Check.

This check requires a Stateflow license.

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 usage of 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 Check.

This check requires a Stateflow license.

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

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 (Simulink), make the following modifications in the Ports and Data Manager (Simulink):

  • 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 Check.

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

  • Stateflow ports if the corresponding signal does not have a label.

Available with Simulink Check.

This check requires a Stateflow license.

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

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

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

Check the number of function calls in MATLAB Function blocks

Check ID: mathworks.maab.na_0017

Description

Checks whether number of function calls in MATLAB Function blocks is less than the set threshold. By default, the limit is set to three.

Results and Recommended Actions

ConditionRecommended Action
Number of function calls in MATLAB Function blocks is greater than the set threshold. by default the set threshold is three. The set threshold can be modified by using the input parameter Function Call Level in the configuration editor.Reduce the number of function calls from MATLAB Function blocks to be less than the set threshold.

Capabilities and Limitations

  • Recursive function calls are only counted once.

  • Inline class methods are not analyzed.

  • Runs on library models.

  • Analyzes content in all masked subsystems.

  • Allows exclusions of blocks and charts.

  • Analyzes content of library linked blocks.

See Also

Check usage of Goto and From blocks between Subsystems

Check ID: mathworks.maab.jc_0171

Description

Checks the signal flow when using Goto and From blocks.

This check identifies the subsystems connected to each other that use Goto and From blocks in feed-forward and feedback loops that do not have at least one signal line for each direction.

Results and Recommended Actions

ConditionRecommended Action
Subsystems connected to each other using Goto and From blocks in feed-forward and feedback loops do not have at least one signal line for each direction.Make sure to add at least one direct signal line in between the connected subsystems.

Capabilities and Limitations

  • The check allows the connections made from the referenced subsystems with in another subsystem.

  • Runs on library models.

  • Analyzes content in all masked subsystems.

  • Allows exclusions of blocks and charts.

  • Analyzes content of library linked blocks.

See Also

Check reuse of variables within a Stateflow scope

Check ID: mathworks.maab.jc_0491

Description

Checks if the defined variables have multiple meanings. The same variable must not have multiple usages within a single Stateflow state.

Available with Simulink Check.

This check requires a Stateflow license.

Results and Recommended Actions

ConditionRecommended Action
Variables with same name are used in a single subsystem. Make sure that all the defined variables are unique including the temporary loop control variables.

Capabilities and Limitations

  • Runs on library models.

  • Analyzes content in all masked subsystems.

  • Allows exclusions of blocks and charts.

  • Analyzes content of library linked blocks.

This check does not run on:

  • MATLAB function block

  • Truth tables

  • Graphical functions

  • If/switch in action language in Stateflow states.

See Also

Check for Stateflow transition appearance

Check ID: mathworks.maab.db_0129

Description

Checks and reports Stateflow transitions that are visually overlapping other Stateflow objects.

Available with Simulink Check.

This check requires a Stateflow license.

Results and Recommended Actions

ConditionRecommended Action
Stateflow transitions overlap with other Stateflow transitions.Avoid having Stateflow transitions overlap with other Stateflow transitions.
Stateflow transitions overlap with labels of other Stateflow transitions.Avoid having Stateflow transitions overlap with labels of other Stateflow transitions.
Stateflow transitions overlap with junctions.Avoid having Stateflow transitions overlap with junctions.
Stateflow transitions overlap with states.Avoid having Stateflow transitions overlap with states.
Stateflow transitions overlap with boxes.Avoid having Stateflow transitions overlap with boxes.
Stateflow transitions overlap with Simulink functions.Avoid having Stateflow transitions overlap with Simulink functions.
Stateflow transitions overlap with MATLAB functions.Avoid having Stateflow transitions overlap with MATLAB functions.
Stateflow transitions overlap with annotations.Avoid having Stateflow transitions overlap with annotations.
Stateflow transitions overlap with truth tables.Avoid having Stateflow transitions overlap with truth tables.
Stateflow transitions labels are not visually associated to the corresponding transition.Transition labels must be visually associated to the corresponding transition.

Capabilities and Limitations

  • JMAAB guideline, Version 5.1 limitations:

    • The check does not flag transition lines that are not drawn vertically or horizontally. (Sub ID: d)

    • The check does not flag unnecessary connective junctions. (Sub ID: e)

    • This check does not report the Stateflow transitions that overlap with the text inside a state that overflows the label of a state.

  • Runs on library models.

  • Analyzes content in all masked subsystems.

  • Allows exclusions of blocks and charts.

  • Analyzes content of library linked blocks.

See Also

Check usage of enumerated values

Check ID: mathworks.maab.na_0031

Description

Identifies the enumeration classes used in the model without a default value specification.

Results and Recommended Actions

ConditionRecommended Action
Enumeration classes in the model do not have a default value specification.Make sure that the enumeration classes used in the model have a getDefaultValue method implementation as a static method of the class.

Capabilities and Limitations

  • Runs on library models.

  • Analyzes content in all masked subsystems.

  • Allows exclusions of blocks and charts.

  • Analyzes content of library linked blocks.

See Also

Check Simulink signal appearance

Check ID: mathworks.maab.db_0032

Description

Checks if the Simulink signals that are intersecting and overlapping adhere to recommended guidelines.

Results and Recommended Actions

ConditionRecommended Action
Simulink signals intersect each other.Make sure that the signals do not intersect with each other.
Simulink signals are not drawn with right angles.Make sure that the signals are drawn with right angles throughout the model.
Simulink signals overlap each other.Make sure that the signals do not overlap with each other.
Simulink signals are drawn over a Simulink block.Make sure that the signals are not drawn over any Simulink blocks.

Capabilities and Limitations

  • JMAAB guideline, Version 5.1 limitations:

    • The check does not verify the Line crossing style property setting. (Sub ID: a2)

    • The check does not flag lines that split into more than two lines at a single branching point. (Sub ID: d)

  • Signal hop preference is not considered.

  • Block label overlaps are not analyzed.

  • Simulink signals that split into more than two signals at a single branch are not considered.

  • Runs on library models.

  • Analyzes content in all masked subsystems.

  • Allows exclusions of subsystems.

  • Analyzes content of library linked blocks.

See Also

Check usage of non-compliant blocks

Check ID: mathworks.maab.na_0027

Description

Identifies the blocks that are not listed in the compliant block list for a model.

Results and Recommended Actions

ConditionRecommended Action

One or more Simulink blocks that are not listed in the compliant block list are used in the model.

Choose Simulink blocks from the compliant block list in configuration parameters dialog box.

Capabilities and Limitations

  • Runs on library models.

  • Analyzes content in all masked subsystems.

  • Allows exclusions of blocks and charts.

  • Analyzes content of library linked blocks.

Edit-Time Checking.  This check is supported by edit-time checking.

See Also