Hauptinhalt

himl_0002: Strong data typing at MATLAB function boundaries

R2026b

Explicitly define the complexity and type of input signals, output signals, and parameters at MATLAB function interfaces

Usage: High-Integrity System Modeling

Guideline ID: himl_0002

Rules

himl_0002: Strong data typing at MATLAB® function boundaries

To support strong data typing at the interfaces of MATLAB functions, explicitly define the interface for input signals, output signals, and parameters, by setting:

  • Complexity

  • Type

Rationale

Defined interfaces:

  • Allow consistency checking of interfaces.

  • Prevent unintended generation of different functions for different input and output types.

  • Simplify testing of functions by limiting the number of test cases.

Verification

Check for MATLAB Function interfaces with inherited properties (Simulink Check)

Example — Correct

Specify the complexity and type of input u1 as follows:

  • Complexity to Off

  • Type to uint16

MATLAB Function block with two uint16 [1x2] inputs and one uint32 [1x2] output, showing explicit data types on signal lines

Example — Incorrect

Do not specify the complexity and type of input u1 as follows:

  • Complexity to Inherited

  • Type to Inherit: Same as Simulink.

Note

To modify the input, from the toolbar of the MATLAB Function Block Editor, select Edit Data.

Industry Standards

  • IEC 61508-3, Table B.9 (6) - Fully defined interface

  • IEC 62304, 5.5.3 - Software Unit acceptance criteria

  • ISO 26262-6, Table 1 (1c) - Enforcement of strong typing
    ISO 26262-6, Table 1 (1f) - Use of unambiguous graphical representation

  • EN 50128, Table A.1 (11) - Software Interface Specifications

  • EN 50657, Table A.1 (11) - Software Interface Specifications

  • EN 50716, Table A.1 (11) - Software Interface Specifications

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

Version History

Introduced in R2013a

expand all