Main Content

Check usage of Switch Case blocks and Switch Case Action Subsystem blocks

Check ID: mathworks.hism.hisl_0011

Description

This check inspects the usage of Switch Case blocks

The check flags Switch Case blocks that do not use integer data types or enumeration values for inputs. To comply with hisl_0011: Usage of Switch Case blocks and Action Subsystem blocks – C, use an integer data type or an enumeration value for the inputs to Switch Case blocks.

Available with Simulink® Check™.

Results and Recommended Actions

ConditionRecommended Action
The model or subsystem contains a Switch Case block without a default case.In the Switch Case block Block Parameters dialog box, select Show default case. Connect the resulting default output port to a Switch Case Action Subsystem block.
The model or subsystem contains a Switch Case block with an output port that does not connect to a Switch Case Action Subsystem block.Verify that output ports of the Switch Case blocks connect to Switch Case Action Subsystem blocks.
The model or subsystem contains a Switch Case block with non-integer or non-enum input port data types.Make sure that input data type of the Switch Case blocks is integer or enum.

Capabilities and Limitations

  • Does not run on library models.

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

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

  • Allows exclusions of blocks and charts.

See Also