Main Content

Check use of default variants

Check ID: mathworks.maab.na_0036

Guideline: na_0036: Default variant

Check use of default variants in a variant subsystem.

Description

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

This check requires a Simulink® Check™ license.

Check Parameterization

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

  1. Open the Model Configuration Editor and search for check ID na_0036.

  2. Under Input Parameters, select Check use of 'Allow zero active variant controls' option.

  3. For each Output ports of the variant subsystem, set the following block parameters:

    • Select Specify output when source is unconnected

    • Enter a Constant value

    • Set the output block parameter Data type to Inherit: auto

  4. Click Apply and save the configuration.

Results and Recommended Actions

ConditionRecommended Action
The subsystem does not contain a default variant.

Set block parameter Variant control to (default).

Block parameter Variant Control is set to Variant.

To set the active variant as the default variant.

  1. Variant Control is set to Variant

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

  3. For output ports of the variant subsystem:

    • Set Specify output when source is unconnected to true

    • Provide a valid value in Constant value

    • Set Output Data type to Inherit: auto

Capabilities and Limitations

  • Runs on library models.

  • Analyzes content of library linked blocks.

  • Analyzes content in all masked subsystems.

  • Allows exclusions of blocks and charts

  • Allows syntax highlighting