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.
MAAB Control Algorithm Modeling (Simulink) guidelines
The Control Algorithm Modeling Guidelines Using MATLAB, Simulink, and Stateflow MAAB guidelines on the MathWorks website
Check ID: mathworks.maab.db_0043
Check for difference in font and font sizes.
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.
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
.
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
.
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
.
Condition | Recommended 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. |
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.
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.
MAAB guideline, Version 3.0: db_0043: Simulink font and font size in the Simulink documentation.
JMAAB guideline, Version 5.1: db_0043: Model font and font size
Check ID: mathworks.maab.db_0132
Check transition orientations in flow charts.
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.
Condition | Recommended 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 transition | Add a default exit transition to the junction. |
Transition has condition and action | Split up condition and action into separate transitions |
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.
MAAB guideline, Version 3.0: db_0132: Transitions in flow charts in the Simulink documentation.
JMAAB guideline, Version 5.1: db_0132: Transitions in Flow Charts
Check ID: mathworks.maab.db_0140
Identify blocks that use nondefault block parameter values that are not displayed in the model diagram.
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.
Condition | Recommended 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. |
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.
If you use the add_block
function with 'built-in/
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.blocktype
'
MAAB guideline, Version 3.0: db_0140: Display of basic block parameters.
JMAAB guideline, Version 5.1: db_0140: Display of block parameters
For a list of block parameter default values, see Block-Specific Parameters (Simulink).
Check ID:
mathworks.maab.na_0032
Check usage of Merge blocks.
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.
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.
Condition | Recommended 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. |
Runs on library models.
Analyzes content of library linked blocks.
Analyzes content in all masked subsystems.
Allows exclusions of blocks and charts.
MAAB guideline, Version 3.0: na_0032: Use of merge blocks in the Simulink documentation.
Check ID:
mathworks.maab.na_0008
Check the labeling on signal lines.
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
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.
Condition | Recommended Action |
---|---|
Signals coming from Bus Selector, Chart, Constant, Data Store Read, Demux, From, Inport, or Selector blocks are not labeled. | Label the signal. |
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.
MAAB guideline, Version 3.0: na_0008: Display of labels on signals in the Simulink documentation.
Signal Names and Labels (Simulink).
Check ID:
mathworks.maab.na_0009
Check for propagated labels on signal lines.
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.
Condition | Recommended 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. |
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.
MAAB guideline, Version 3.0: na_0009: Entry versus propagation of signal labels in the Simulink documentation.
Signal Names and Labels (Simulink).
Check ID:
mathworks.maab.jc_0531
Check default transition placement in Stateflow charts.
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.
Condition | Recommended 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. |
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.
MAAB guideline, Version 3.0: jc_0531: Placement of the default transition in the Simulink documentation.
JMAAB guideline, Version 5.1: jc_0531: Default transition
Syntax for States and Transitions (Stateflow)
Check ID: mathworks.maab.jc_0511
Identify graphical functions with multiple assignments of return values in Stateflow charts.
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.
Condition | Recommended 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. |
Runs on library models.
Does not analyze content of library linked blocks.
Analyzes content in all masked subsystems.
Allows exclusions of blocks and charts.
MAAB guideline, Version 3.0: jc_0511: Setting the return value from a graphical function in the Simulink documentation.
JMAAB guideline, Version 5.1: jc_0511: Setting the return value from a graphical function
Reusable Functions in Charts (Stateflow).
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.
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.
Condition | Recommended 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. |
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.
MAAB guideline, Version 3.0: jc_0501: Format of entries in a State block in the Simulink documentation.
Check ID: mathworks.maab.jc_0521
Identify calls to graphical functions in conditional expressions.
Do not use the return value of a graphical function in a comparison operation.
Available with Simulink Check.
This check requires a Stateflow license.
Condition | Recommended 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. |
Runs on library models.
Does not analyze content of library linked blocks.
Analyzes content in all masked subsystems.
Allows exclusions of blocks and charts.
MAAB guideline, Version 3.0: jc_0521: Use of the return value from graphical functions in the Simulink documentation.
Reusable Functions in Charts (Stateflow).
Reuse Logic Patterns by Defining Graphical Functions (Stateflow).
Check ID: mathworks.maab.jm_0011
Identify pointer operations on custom code variables.
Pointers to custom code variables are not allowed.
Available with Simulink Check.
This check requires a Stateflow license.
Condition | Recommended Action |
---|---|
Custom code variables use pointer operations. | Modify the specified chart to remove the dependency on pointer operations. |
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.
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 ID: mathworks.maab.jm_0012
Identify undirected event broadcasts that might cause recursion during simulation and generate inefficient code.
Event broadcasts in Stateflow charts must be directed.
Available with Simulink Check.
This check requires a Stateflow license.
Condition | Recommended 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. |
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.
MAAB guideline, Version 3.0: jm_0012: Event broadcasts in the Simulink documentation.
JMAAB guideline, Version 5.1: jm_0012: Usage restrictions of events and broadcasting events
Broadcast Local Events to Synchronize Parallel States (Stateflow).
Check ID: mathworks.maab.db_0151
Identify missing line breaks between transition actions.
For readability, start each transition action on a new line.
Available with Simulink Check.
This check requires a Stateflow license.
Condition | Recommended Action |
---|---|
Multiple transition actions are on a single line. | Verify that each transition action begins on a new line. |
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.
MAAB guideline, Version 3.0: db_0151: State machine patterns for transition actions in the Simulink documentation.
JMAAB guideline, Version 5.1: db_0151: State machine patterns for transition actions.
Syntax for States and Transitions (Stateflow)
Check ID: mathworks.maab.db_0127
Identify Stateflow objects that use MATLAB® expressions that are not suitable for code generation.
Do not use MATLAB functions, instructions, and operators in Stateflow objects.
Available with Simulink Check.
This check requires a Stateflow license.
Condition | Recommended Action |
---|---|
Stateflow objects use MATLAB expressions. | Replace MATLAB expressions in Stateflow objects. |
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.
MAAB guideline, Version 3.0: db_0127: MATLAB commands in Stateflow in the Simulink documentation.
JMAAB guideline, Version 5.1: db_0127: Limitation on MATLAB commands in Stateflow blocks
Access MATLAB Functions and Workspace Data in C Charts (Stateflow).
Check ID:
mathworks.maab.db_0112
Check that blocks use consistent vector indexing.
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:
Object | Indexing |
---|---|
|
|
| Zero-based indexing ([0, 1, 2, ...]) |
| One-based indexing ([1, 2, 3,...]) |
Condition | Recommended 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. |
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.
MAAB guideline, Version 3.0: db_0112: Indexing in the Simulink documentation.
JMAAB guideline, Version 5.1: db_0112: Usage of index
Check ID: mathworks.maab.ar_0001
Checks the names of all files residing in the same folder as the model
A file name conforms to constraints.
Available with Simulink Check.
Condition | Recommended 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. |
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.
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 ID: mathworks.maab.ar_0002
Checks model directory and subdirectory names for invalid characters.
A directory name conforms to constraints.
Available with Simulink Check.
Condition | Recommended 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. |
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.
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 ID: mathworks.maab.jm_0001
Check for prohibited blocks in discrete controllers.
The check identifies continuous blocks in discrete controller models.
Available with Simulink Check.
To change the list of blocks that the check flags, you can use the Model Advisor Configuration Editor.
Open the Model Configuration Editor and navigate to Check for prohibited blocks in discrete controllers.
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.
Click Apply.
Save the configuration. When you run the check using this configuration, the check uses the specified input parameters.
Condition | Recommended 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). |
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.
MAAB guideline, Version 3.0: jm_0001: Prohibited Simulink standard blocks inside controllers in the Simulink documentation.
JMAAB guideline, Version 5.1: jm_0001: Prohibited Simulink standard blocks inside controllers.
Check ID: mathworks.maab.hd_0001
Check for prohibited Simulink sink blocks.
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.
To change the list of blocks that the check flags, you can use the Model Advisor Configuration Editor.
Open the Model Configuration Editor and navigate to Check for prohibited sink blocks.
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.
Click Apply.
Save the configuration. When you run the check using this configuration, the check uses the specified input parameters.
Condition | Recommended Action |
---|---|
Sink blocks are not permitted in discrete controllers. | Remove sink blocks from the model. |
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.
MAAB guideline, Version 3.0: hd_0001: Prohibited Simulink sinks in the Simulink documentation.
JMAAB guideline, Version 5.1: hd_0001: Prohibited Simulink sinks.
Check ID: mathworks.maab.db_0042
Check whether the model contains ports with invalid position and configuration.
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.
Condition | Recommended 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. |
|
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
MAAB guideline, Version 3.0: db_0042: Port block in Simulink models in the Simulink documentation.
JMAAB guideline, Version 5.1: db_0042: Usage of Inport and Outport blocks
Check ID: mathworks.maab.jm_0010
Check for mismatches between names of ports and corresponding signals.
Use matching names for ports and their corresponding signals.
Available with Simulink Check.
Prerequisite MAAB guidelines, Version 3.0, for this check are:
Condition | Recommended 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. |
Runs on library models.
Analyzes content of library linked blocks.
Analyzes content in all masked subsystems.
Allows exclusions of blocks and charts.
MAAB guideline, Version 3.0: jm_0010: Port block names in Simulink models in the Simulink documentation.
Check ID: mathworks.maab.db_0142
Check whether block names appear below blocks.
If shown, the name of the block should appear below the block.
Available with Simulink Check.
Condition | Recommended Action |
---|---|
Blocks have names that do not appear below the blocks. | Set the name of the block to appear below the blocks. |
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.
MAAB guideline, Version 3.0: db_0142: Position of block names in the Simulink documentation.
JMAAB guideline, Version 5.1: db_0142: Position of block names.
Check ID: mathworks.maab.db_0143
Check for systems that mix primitive blocks and subsystems.
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.
To change the list of blocks that the check flags, you can use the Model Advisor Configuration Editor.
Open the Model Configuration Editor and navigate to Check for mixing basic blocks and subsystems.
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.
Click Apply.
Save the configuration. When you run the check using this configuration, the check uses the specified input parameters.
Condition | Recommended Action |
---|---|
A level in the model includes subsystem blocks and primitive blocks. | Move nonvirtual blocks into the subsystem. |
Runs on library models.
Analyzes content of library linked blocks.
Analyzes content in all masked subsystems.
Allows exclusions of blocks and charts.
MAAB guideline, Version 3.0: db_0143: Similar block types on the model levels in the Simulink documentation.
JMAAB guideline, Version 5.1: db_0143: Usage block types in model hierarchy
Check ID: mathworks.maab.db_0081
Check whether model has unconnected input ports, output ports, or signal lines.
Unconnected inputs should be connected to ground blocks. Unconnected outputs should be connected to terminator blocks.
Available with Simulink Check.
Condition | Recommended Action |
---|---|
Blocks have unconnected inputs or outputs. | Connect unconnected lines to blocks specified by the design or to Ground or Terminator blocks. |
Runs on library models.
Analyzes content of library linked blocks.
Analyzes content in all masked subsystems.
Allows exclusions of blocks and charts.
MAAB guideline, Version 3.0: db_0081: Unconnected signals, block inputs and block outputs in the Simulink documentation.
JMAAB guideline, Version 5.1: db_0081: Unconnected signals / block
Check ID: mathworks.maab.db_0146
Check the position of Trigger and Enable blocks.
Locate blocks that define subsystems as conditional or iterative at the top of the subsystem diagram.
Available with Simulink Check.
Condition | Recommended 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. |
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.
MAAB guideline, Version 3.0: db_0146: Triggered, enabled, conditional Subsystems in the Simulink documentation.
JMAAB guideline, Version 5.1: db_0146: Block layout in conditional subsystems
Check ID: mathworks.maab.db_0110
Check whether tunable parameters specify expressions, data type conversions, or indexing operations.
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.
Condition | Recommended 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. |
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.
MAAB guideline, Version 3.0: db_0110: Tunable parameters in basic blocks in the Simulink documentation.
JMAAB guideline, Version 5.1: db_0110: Guidelines for block parameters
Check ID: mathworks.maab.db_0125
Check whether Stateflow data objects with local scope are defined at the chart level or below.
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.
Condition | Recommended 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. |
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.
MAAB guideline, Version 3.0: db_0125: Scope of internal signals and local auxiliary variables in the Simulink documentation.
JMAAB guideline, Version 5.1: db_0125: Stateflow local data
Check ID: mathworks.maab.db_0122
Check whether labeled Stateflow and Simulink input and output signals are strongly typed.
Strong data typing between Stateflow and Simulink input and output signals is required.
Available with Simulink Check.
This check requires a Stateflow license.
Condition | Recommended 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. |
Runs on library models.
Analyzes content of library linked blocks and charts.
Analyzes content in all masked subsystems.
Allows exclusions of blocks and charts.
MAAB guideline, Version 3.0: db_0122: Stateflow and Simulink interface signals and parameters in the Simulink documentation.
JMAAB guideline, Version 5.1: db_0122: Stateflow and Simulink interface signals and parameters
Syntax for States and Transitions (Stateflow)
Check ID: mathworks.maab.db_0137
Check states in state machines.
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.
A prerequisite MAAB guideline, Version 3.0, for this check is db_0149: Flow chart patterns for condition actions.
Condition | Recommended 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. |
Runs on library models.
Does not analyze content of library linked blocks.
Analyzes content in all masked subsystems.
Allows exclusions of blocks and charts.
MAAB guideline, Version 3.0: db_0137: States in state machines in the Simulink documentation.
Check ID: mathworks.maab.jc_0011
Check the optimization parameter for Boolean data types.
Optimization for Boolean data types is required
Available with Simulink Check.
A prerequisite MAAB guideline, Version 3.0, for this check is na_0002: Appropriate implementation of fundamental logical and numerical operations.
Condition | Recommended 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. |
Does not run on library models.
Does not allow exclusions of blocks or charts.
MAAB guideline, Version 3.0: jc_0011: Optimization parameters for Boolean data types in the Simulink documentation.
JMAAB guideline, Version 5.1: jc_0011: Optimization parameters for Boolean data types.
Check ID: mathworks.maab.jc_0021
Check the model diagnostics configuration parameter settings.
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.
Condition | Recommended 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 . |
Does not run on library models.
Does not allow exclusions of blocks or charts.
MAAB guideline, Version 3.0: jc_0021: Model diagnostic settings in the Simulink documentation.
Check ID: mathworks.maab.jc_0061
Check the display attributes of subsystem and block names.
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.
Open the Model Configuration Editor and navigate to Check
the display attributes of block names. In the
Input Parameters pane, select
Custom
.
Use the Block type list table to include or exclude blocks and masks from the check.
Click Apply.
Save the configuration. When you run the check using this configuration, the check uses the input parameters that you specified.
Condition | Recommended Action |
---|---|
Name is displayed and obvious from the block appearance. | Hide the block name by selecting Format > Hide Automatic Block Name. |
Name is not descriptive. Specifically, the block name is:
| Modify the block name to provide descriptive information, or hide the block name by selecting Format > Hide Automatic Block Name. |
Name is descriptive and not displayed. Descriptive names are:
| Modify the blocks to show the block name by deselecting Format > Hide Automatic Block Name. |
Check does not evaluate my custom blocks and masks. | Use the Model Configuration Editor to specify your custom checks and blocks. |
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.
MAAB guideline, Version 3.0: jc_0061: Display of block names in the Simulink documentation.
JMAAB guideline, Version 5.1: jc_0061: Display of block names
Check ID: mathworks.maab.jc_0081
Check the Icon display setting for Inport and Outport blocks.
The Icon display setting is required.
Available with Simulink Check.
Condition | Recommended Action |
---|---|
The Icon display setting is not set. | Set the Icon display to Port number for the specified Inport and Outport blocks. |
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.
MAAB guideline, Version 3.0: jc_0081: Icon display for Port block in the Simulink documentation.
Check ID: mathworks.maab.jc_0201
Check whether subsystem block names include invalid characters.
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.
To control the naming convention for blocks that the check flags, you can use the Model Advisor Configuration Editor.
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)|(^ )|(^_)|(_$)
.
Click Apply.
Save the configuration. When you run the check using this configuration, the check uses the input parameters that you specified.
Condition | Recommended 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. |
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.
Use underscores to separate parts of a subsystem name instead of spaces.
MAAB guideline, Version 3.0: jc_0201: Usable characters for Subsystem names in the Simulink documentation.
JMAAB guideline, Version 5.1: jc_0201: Usable characters for Subsystem names
Check ID: mathworks.maab.jc_0211
Check whether Inport and Outport block names include invalid characters.
The names of all Inport and Outport blocks are checked for invalid characters.
Available with Simulink Check.
To control the naming convention for blocks that the check flags, you can use the Model Advisor Configuration Editor.
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)|(^ )|(^_)|(_$)
.
Click Apply.
Save the configuration. When you run the check using this configuration, the check uses the input parameters that you specified.
Condition | Recommended 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. |
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.
Use underscores to separate parts of a block name instead of spaces.
MAAB guideline, Version 3.0: jc_0211: Usable characters for Inport blocks and Outport blocks in the Simulink documentation.
JMAAB guideline, Version 5.1: jc_0211: Usable characters for Inport block and Outport block
Check ID: mathworks.maab.jc_0221
Check whether signal line names include invalid characters.
The names of all signal lines are checked for invalid characters.
Available with Simulink Check.
Condition | Recommended 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. |
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.
Use underscores to separate parts of a signal line name instead of spaces.
MAAB guideline, Version 3.0: jc_0221: Usable characters for signal line names in the Simulink documentation.
JMAAB guideline, Version 4.0: jc_0222: Usable characters for signal line and bus names.
Check ID:
mathworks.maab.na_0030
Checks Simulink bus signal names.
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.
To specify the naming standard for Simulink bus signal names, use the Model Advisor Configuration Editor.
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)|(^
)|(^_)|(_$)
Click Apply.
Save the configuration. When you run the check using this configuration, the check uses the input parameters that you specified.
Condition | Recommended 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. |
Analyzes content in all masked subsystems.
Allows exclusions of blocks and charts.
Allows syntax highlighting.
MAAB guideline, Version 3.0: na_0030: Usable characters for Simulink Bus names in the Simulink documentation.
JMAAB guideline, Version 4.0: jc_0222: Usable characters for signal line and bus names.
Check ID: mathworks.maab.jc_0231
Check whether block names include invalid characters.
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.
A prerequisite MAAB guideline, Version 3.0, for this check is jc_0201: Usable characters for Subsystem names.
To control the naming convention for blocks that the check flags, you can use the Model Advisor Configuration Editor.
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)|(^ )
.
Click Apply.
Save the configuration. When you run the check using this configuration, the check uses the input parameters that you specified.
Condition | Recommended 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. |
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.
Carriage returns are allowed in block names.
MAAB guideline, Version 3.0: jc_0231: Usable characters for block names in the Simulink documentation.
JMAAB guideline, Version 5.1: jc_0231: Usable characters for block names
Check ID: mathworks.maab.jc_0281
Check Trigger and Enable block port names.
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.
Condition | Recommended 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. |
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.
MAAB guideline, Version 3.0: jc_0281: Naming of Trigger Port block and Enable Port block in the Simulink documentation.
JMAAB guideline, Version 5.1: jc_0281: Trigger signal names
Check ID: mathworks.maab.na_0004
Check model appearance setting attributes.
Model appearance settings are required to conform to the guidelines when the model is released.
Available with Simulink Check.
Condition | Recommended Action |
---|---|
The toolbar is not visible. | Select Modeling > Environment > Toolstrip. |
The status bar is not visible. | Select Modeling > Environment > Status Bar. |
Sample Time > Colors is selected. | Clear Debug > Information Overlays > Colors. |
Wide Nonscalar Lines is cleared. | Select Debug > Information Overlays > Nonscalar Signals. |
Viewer Indicators is cleared. | Select Debug > Information Overlays > Viewers. |
Testpoint Indicators is cleared. | Select Debug > Information Overlays > Log & Testpoint. |
Port Data Types is selected. | Clear Debug > Information Overlays > Port Data Type. |
Storage Class is selected. | Clear Debug > Information Overlays > Storage Class. |
Signal Dimensions is selected. | Clear Debug > Information Overlays > Signal Dimensions. |
Execution Context Indicator is selected. | Clear Display > Signals & Ports > Execution Context Indicator. |
Model Browser is selected. | Clear Modeling > Environment > Model Browser. |
Sorted Execution Order is selected. | Clear Debug > Information Overlays > Execution Order. |
Model Block Version is selected. | Clear Debug > Information Overlays > Ref. Model Version. |
Model Block I/O Mismatch is selected. | Clear Debug > Information Overlays > Ref. Model I/O Mismatch. |
Library Links is set Disabled , User
Defined , or
All . | Select Debug > Information Overlays > Show All Links. |
Linearization Indicators is cleared. | Select Debug > Information Overlays > Linearization Indicators. |
Block backgrounds are not white. | For each listed diagram, click the canvas and select Format > Background. |
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%. | For each listed diagram, select Modeling > Environment > Zoom > Normal View (100%). |
Clicking Modify updates the display attributes to conform to the guideline.
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.
MAAB guideline, Version 3.0: na_0004: Simulink model appearance in the Simulink documentation.
JMAAB guideline, Version 5.1: na_0004: Simulink model appearance settings
Check ID: mathworks.maab.na_0024
Check for global variables in MATLAB code.
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.
Condition | Recommended Action |
---|---|
Global variables are used in one or more of the following:
| Replace global variables with signal lines, function arguments, or persistent data. |
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.
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 ID: mathworks.maab.na_0005
Check the visibility of port block names.
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.
Select this check box if all ports should show the name, including subsystems.
Condition | Recommended 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 . |
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.
MAAB guideline, Version 3.0: na_0005: Port block name visibility in Simulink models in the Simulink documentation.
Check ID: mathworks.maab.jc_0111
Check the orientation of subsystem blocks.
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.
Condition | Recommended Action |
---|---|
Subsystem blocks are not using the right orientation | Rotate the subsystem so that inputs are on the left side of block and outputs are on the right side of the block. |
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.
MAAB guideline, Version 3.0: jc_0111: Direction of Subsystem in the Simulink documentation.
JMAAB guideline, Version 5.1: jc_0111: Direction of Subsystem.
Check ID: mathworks.maab.jc_0131
Check the position of Constant blocks used in Relational Operator blocks.
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.
Condition | Recommended Action |
---|---|
Relational Operator blocks have a Constant block on the first, upper input. | Move the Constant block to the second, lower input. |
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.
MAAB guideline, Version 3.0: jc_0131: Use of Relational Operator block in the Simulink documentation.
JMAAB guideline, Version 5.1: jc_0131: Usage of Relational Operators
Check ID: mathworks.maab.jc_0141
Check usage of Switch blocks.
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.
Condition | Recommended 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. |
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.
MAAB guideline, Version 3.0: jc_0141: Use of the Switch block in the Simulink documentation.
JMAAB guideline, Version 5.1: jc_0141: Use of the Switch block
Switch block
Check ID: mathworks.maab.na_0010
Check usage of buses and Mux blocks.
This check verifies the usage of buses and Mux blocks.
Available with Simulink Check.
Condition | Recommended 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. |
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.
MAAB guideline, Version 3.0: na_0010: Grouping data flows into signalsin the Simulink documentation.
Composite Signals (Simulink)
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.
Do not use bitwise operators in Stateflow charts, unless you enable bitwise operations.
Available with Simulink Check.
This check requires a Stateflow license.
Condition | Recommended 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:
|
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.
MAAB guideline, Version 3.0: na_0001: Bitwise Stateflow operators in the Simulink documentation.
JMAAB guideline, Version 5.1: na_0001: Standard usage of Stateflow operators
Binary Operations (Stateflow).
Check ID: mathworks.maab.na_0002
Checks data types in numerical and logic blocks.
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:
These blocks also accept numeric input but are not included as part of this check:
Available with Simulink Check.
To specify the custom blocks and masks to include in this check, use the Model Advisor Configuration Editor.
Open the Model Configuration Editor and navigate to Check
fundamental logical and numerical operations. In the
Input Parameters pane, select
Custom
.
Use the Blocks for Numerical Operations and Blocks for Logical Operations tables to include or exclude blocks and masks from the check.
Click Apply.
Save the configuration. When you run the check using this configuration, the check uses the input parameters that you specified.
Condition | Recommended 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. |
Runs on library models.
Analyzes content of library linked blocks.
Analyzes content in all masked subsystems.
Allows exclusions of blocks and charts.
MAAB guideline, Version 3.0: na_0002: Appropriate implementation of fundamental logical and numerical operations in the Simulink documentation.
Check ID: mathworks.maab.na_0003
Check If blocks for inappropriate construct of primary expressions in a logical expression.
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 Expression | Reasoning |
---|---|
| Too many primary expressions. |
| Unacceptable operator within primary expression. |
| Too many primary expressions that are not inputs. |
| 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.
Condition | Recommended Action |
---|---|
Logical expression contains more than two primary expressions that consist of a constant, constant parameter, and input. | Consider one of the following:
|
Logical expression contains more than two parenthesized expressions that use multiple relational operators | Consider one of the following:
|
Parenthesized expression includes a relational operator other than
zero or < , > ,
>= , <= ,
== , ~= , | ,
& , or ~ . | Consider one of the following:
|
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.
MAAB guideline, Version 3.0: na_0003: Simple logical expressions in If Condition block in the Simulink documentation.
Check ID: mathworks.maab.na_0013
Identify comparison operations with different data types in Stateflow objects.
Comparisons should be made between variables of the same data types.
Available with Simulink Check.
This check requires a Stateflow license.
Condition | Recommended 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. |
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.
MAAB guideline, Version 3.0: na_0013: Comparison operation in Stateflow in the Simulink documentation.
Check ID:
mathworks.maab.na_0019
Check for use of reserved keywords in MATLAB Function block variable names.
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.
Condition | Recommended Action |
---|---|
Variable name conflicts with reserved keyword. | Consider using a different variable name that does not conflict with the reserved keywords. |
Runs on library models.
Analyzes content of library linked blocks.
Analyzes content in all masked subsystems.
MAAB guideline, Version 3.0: na_0019: Restricted Variable Names in the Simulink documentation.
Check ID: mathworks.maab.na_0020
Checks variant subsystems for unused ports.
Checks variant subsystems for unused ports and provides the action to terminate the unused inputs with a Terminator block.
Condition | Recommended 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.
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.
MAAB guideline, Version 3.0: na_0020: Number of inputs to variant subsystems in the Simulink documentation.
Check ID:
mathworks.maab.na_0021
Check for use of character vectors in MATLAB Function blocks.
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.
Condition | Recommended Action |
---|---|
MATLAB Function block contains a character vector. | Consider using enumerations instead of character vectors. |
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.
MAAB guideline, Version 3.0: na_0021: Strings in the Simulink documentation.
Check ID:
mathworks.maab.na_0022
Check for use of non-constant variables in Switch/Case statements.
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.
Condition | Recommended Action |
---|---|
Non-constant variables are used in the Switch/Case statement. | Consider defining the input variable as a constant. |
Runs on library models.
Analyzes content of library linked blocks.
Analyzes content in all masked subsystems.
MAAB guideline, Version 3.0: na_0022: Recommended patterns for Switch/Case statements in the Simulink documentation.
Check ID:
mathworks.maab.na_0036
Check use of default variants in a variant subsystem.
Checks Variant Subsystem, Variant Source, Variant Sink, and variant Model blocks in a variant subsystem for a default variant.
Available with Simulink Check.
To set the active variant as the default variant, use the Model Advisor Configuration Editor.
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.
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
Click Apply.
Save the configuration. When you run the check using this configuration, the check uses the input parameters that you specified.
Condition | Recommended Action |
---|---|
The subsystem does not contain a default variant. | Set block parameter Variant control to
|
Block parameter Variant Control is set to
Variant . | To set the active variant as the default variant.
|
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
MAAB guideline, Version 3.0: na_0036: Default variant in the Simulink documentation.
Check ID:
mathworks.maab.na_0037
Check use of single variables in conditional expressions
Checks Variant Subsystem, Variant Source, Variant Sink, and variant Model blocks for conditional expressions that have more than one variable.
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.
Condition | Recommended Action |
---|---|
Conditional expression contains more than one condition variable. | Consider updating your model so that only one variant is used. |
Conditional expression variable or | 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. |
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.
MAAB guideline, Version 3.0: na_0037: Use of single variable variant conditionals in the Simulink documentation.
Check ID:
mathworks.maab.na_0038
Checks the depth of nested states in Stateflow charts.
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.
To specify the threshold for nesting levels of Stateflow states, use the Model Advisor Configuration Editor.
Open the Model Configuration Editor and navigate to Check nested states in Stateflow charts.
In the Input Parameters pane, enter the nesting level
threshold. The default value is 3
.
Click Apply.
Save the configuration. When you run the check using this configuration, the check uses the input parameters that you specified.
Condition | Recommended 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. |
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.
MAAB guideline, Version 3.0: na_0038: Levels in Stateflow charts in the Simulink documentation.
Check ID:
mathworks.maab.na_0039
Checks for Stateflow charts that are nested in Simulink functions used in the root Stateflow chart.
Checks Simulink functions in the root Stateflow chart and identifies Stateflow charts that are nested within these functions.
Available with Simulink Check.
Condition | Recommended 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. |
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.
MAAB guideline, Version 3.0: na_0039: Use of Simulink in Stateflow charts in the Simulink documentation.
Check ID: mathworks.maab.na_0040
Checks the number of viewable states within a Stateflow container.
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.
To specify the threshold for the number of viewable states in a Stateflow container, use the Model Advisor Configuration Editor.
Open the Model Configuration Editor and navigate to Check number of Stateflow states per container.
In the Input Parameters pane, enter the threshold for
the number of viewable states per container. The default value is
10
.
Click Apply.
Save the configuration. When you run the check using this configuration, the check uses the input parameters that you specified.
Condition | Recommended 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. |
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.
MAAB guideline, Version 3.0: na_0040: Number of states per container in the Simulink documentation.
Check ID: mathworks.maab.jc_0451
Identify unary minus operations applied to unsigned integers in Stateflow objects.
Do not perform unary minus operations on unsigned integers in Stateflow objects.
Available with Simulink Check.
This check requires a Stateflow license.
Condition | Recommended 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. |
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.
MAAB guideline, Version 3.0: jc_0451: Use of unary minus on unsigned integers in Stateflow in the Simulink documentation.
JMAAB guideline, Version 5.1: jc_0451: Use of unary minus on unsigned integers
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.
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.
Condition | Recommended 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. |
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.
MAAB guideline, Version 3.0: jc_0481: Use of hard equality comparisons for floating point numbers in Stateflow in the Simulink documentation.
Check ID: mathworks.maab.na_0034
Identify MATLAB Functions that have inputs, outputs or parameters with inherited complexity or data type properties.
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.
Condition | Recommended 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):
|
Runs on library models.
Does not analyze content of library linked blocks.
Analyzes content in all masked subsystems.
Allows exclusions of blocks and charts.
MAAB guideline, Version 3.0: na_0034: MATLAB Function block input/output settings in the Simulink documentation.
JMAAB guideline, Version 5.1: na_0034: MATLAB Function block input/output settings
Check ID: mathworks.maab.himl_0003
Display complexity and code metrics for MATLAB Functions. Report metric violations.
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.
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.
Provide minimum density of comments. Density is ratio of comment lines to total lines of code.
Provide maximum cyclomatic complexity per function. Cyclomatic complexity is the number of linearly independent paths through the source code.
Condition | Recommended Action |
---|---|
MATLAB Function violates the complexity input parameters. | For the MATLAB Function:
|
Runs on library models.
Does not analyze content of library linked blocks.
Analyzes content in all masked subsystems.
Allows exclusions of blocks and charts.
MAAB guideline, Version 3.0: na_0016: Source lines of MATLAB Functions in the Simulink documentation.
MAAB guideline, Version 3.0: na_0018: Number of nested if/else and case statement in the Simulink documentation.
Check ID: mathworks.maab.db_0123
Check for mismatches between Stateflow ports and associated signal names.
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.
Condition | Recommended Action |
---|---|
Signals have names that differ from the corresponding Stateflow ports. | Change the names of either the signals or the Stateflow ports. |
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.
MAAB guideline, Version 3.0: db_0123: Stateflow port names in the Simulink documentation.
Check ID:
mathworks.maab.na_0011
Check the scope of From and Goto blocks.
You can use global scope for controlling flow. However, From and Goto blocks must use local scope for signal flows.
Available with Simulink Check.
Condition | Recommended Action |
---|---|
From and Goto blocks are not configured with local scope. |
|
Does not run on library models.
Analyzes content of library linked blocks.
Analyzes content in all masked subsystems.
Allows exclusions of blocks and charts.
MAAB guideline, Version 3.0: na_0011: Scope of Goto and From blocks in the Simulink documentation.
Check ID:
mathworks.maab.na_0017
Checks whether number of function calls in MATLAB Function blocks is less than the set threshold. By default, the limit is set to three.
Condition | Recommended 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. |
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.
MAAB guideline, Version 3.0: na_0017: Number of called function levels in the Simulink documentation.
Check ID:
mathworks.maab.jc_0171
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.
Condition | Recommended 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. |
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.
MAAB guideline, Version 3.0: jc_0171: Maintaining signal flow when using Goto and From blocks
Check ID:
mathworks.maab.jc_0491
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.
Condition | Recommended 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. |
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.
MAAB guideline, Version 3.0: jc_0491: Reuse of variables within a single Stateflow scope
Check ID:
mathworks.maab.db_0129
Checks and reports Stateflow transitions that are visually overlapping other Stateflow objects.
Available with Simulink Check.
This check requires a Stateflow license.
Condition | Recommended 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. |
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.
MAAB guideline, Version 3.0: db_0129: Stateflow transition appearance
Check ID:
mathworks.maab.na_0031
Identifies the enumeration classes used in the model without a default value specification.
Condition | Recommended 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. |
Runs on library models.
Analyzes content in all masked subsystems.
Allows exclusions of blocks and charts.
Analyzes content of library linked blocks.
MAAB guideline, Version 3.0: na_0031: Definition of default enumerated value
Check ID:
mathworks.maab.db_0032
Checks if the Simulink signals that are intersecting and overlapping adhere to recommended guidelines.
Condition | Recommended 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. |
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.
MAAB guideline, Version 3.0: db_0032: Simulink signal appearance
Check ID:
mathworks.maab.na_0027
Identifies the blocks that are not listed in the compliant block list for a model.
Condition | Recommended 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. |
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.
MAAB guideline, Version 3.0: na_0027: Use of only standard library blocks in the Simulink documentation.
Blocks and Products Supported for Code Generation (Simulink Coder)