Contenido principal

hisl_0010: Usage of If blocks and If Action Subsystem blocks

R2026b

Connect If block outports to If Action Subsystem blocks and use else conditions to support verifiable generated code

Usage: High-Integrity System Modeling

Guideline ID: hisl_0010

Prerequisite: hisl_0016: Usage of blocks that compute relational operators

Rules

hisl_0010: Usage of If blocks and If Action Subsystem blocks
A

To support verifiable generated code, when using the If block with nonempty Elseif expressions, select block parameter Show else condition.

Rationale

Support generation of verifiable code.

Verification

Check usage of If blocks and If Action Subsystem blocks (Simulink Check)

Example — Correct

If block with Elseif expressions has Show else condition selected, with all outports connected to If Action Subsystem blocks.

If block with if, elseif, and else outports each connected to an If Action Subsystem block feeding a Merge block

Example — Incorrect

If block with Elseif expressions does not have an else path.

If block with if and elseif outports connected to If Action Subsystem blocks but no else condition

B

To support verifiable generated code, when using the If block with nonempty Elseif expressions, connect the outports of the If block to If Action Subsystem blocks.

Rationale

Support generation of verifiable code.

Verification

Check usage of If blocks and If Action Subsystem blocks (Simulink Check)

Example — Correct

If block with only an if condition has its outport connected to an If Action Subsystem block.

If block with single if condition outport connected to an If Action Subsystem block

Tips

  • The combination of If and If Action Subsystem blocks enable conditional execution based on input conditions. When there is only an if branch, you do not need to include an else branch.

Industry Standards

  • DO-331, Section MB.6.3.2.d – 'Low-level requirements are verifiable'
    DO-331 Section MB.6.3.2.b – Low-level requirements are accurate and consistent

  • IEC 61508-3, Table A.3 (3) 'Language subset'
    IEC 61508-3, Table A.4 (3) 'Defensive programming'

  • IEC 62304, 5.5.3 - Software Unit acceptance criteria

  • ISO 26262–6, Table 1(b) 'Use of language subsets'
    ISO 26262–6, Table 1(d) 'Use of defensive implementation techniques'

  • EN 50128, Table A.4 (11) 'Language Subset'
    EN 50128, Table A.3 (1) 'Defensive Programming'

  • EN 50657, Table A.4 (11) 'Language Subset'
    EN 50657, Table A.3 (1) 'Defensive Programming'

  • EN 50716, Table A.3 (1) 'Defensive Programming'

  • MISRA C:2012, Rule 14.2
    MISRA C:2012, Rule 16.4
    MISRA C:2012, Dir 4.1

  • MISRA C:2023, Rule 14.2
    MISRA C:2023, Rule 16.4
    MISRA C:2023, Dir 4.1

Version History

Introduced in R2010a

expand all