Main Content

Check character usage in block names

Check ID: mathworks.jmaab.jc_0231

Guideline: jc_0231: Usable characters for block names

Description

Checks if block names adhere to the following guideline standards.

  • Do not begin with a number.

  • Do not begin or end with an underscore.

  • Do not contain consecutive underscores.

  • Do not coincide with reserved MATLAB® words.

  • Contain only alphanumeric characters and underscores.

Note

Reserved MATLAB words include the following:

Following are the special conditions the check verifies:

  • If the block name is default block name and is hidden then the check will not report the block. This is because the block is a Simulink® Library block.

  • If the block name is default block name and is visible, then the check reports the block. This is because the block name now affects readability.

  • If the block name is not default, and if it violates any conditions of the Sub-IDs, then the check reports even if it is visible or hidden.

This check requires a Simulink Check™ license.

Check Parameterization

This check contains sub-checks that correspond to sub IDs specified in the MAB and JMAAB modeling guidelines. You can use the Model Advisor Configuration Editor to specify which sub IDs (one or multiple) to execute.

For reference, the MAB guideline sub ID(s) that are recommended for use by the NA-MAAB and JMAAB modeling standards organizations are:

  • NA-MAAB — a, b, c, d, e, f

  • JMAAB — a, b, c, d, e, f

Results and Recommended Actions

Guideline Sub ID ConditionRecommended Action
jc_0231_a: Characters allowed for block namesOne or more blocks in the model have invalid names.Use only alphanumeric characters and underscores in block names.
jc_0231_b: Number at the beginningOne or more block names begin with a number.Use alphabetic characters at the beginning of block names.
jc_0231_c: Underscore at the beginningOne or more block names begin with an underscore.Use alphabetic characters at the beginning of block names.
jc_0231_d: Underscore at the endOne or more block names end with an underscore.Do not end block names with underscores.
jc_0231_e: Consecutive underscoresOne or more block names have consecutive underscores.Do not use consecutive underscores in block names.
jc_0231_f: Single reserved MATLAB wordThe block name is a reserved MATLAB word.Do not use reserved MATLAB words as block names.

Capabilities and Limitations

  • Supports selection of Guideline Sub IDs.

  • Runs on library models.

  • Analyzes content in masked subsystems. By default, the input parameter Look under masks is set to graphical.

  • Analyzes content of library-linked blocks. By default, the input parameter Follow links is set to on.

  • Supports exclusions of blocks or charts.

Edit-Time Checking

This check is supported by edit-time checking.