Main Content

Configure Internal Data Types for AUTOSAR IncludedDataTypeSets

In an AUTOSAR software component model, you can import and export an ARXML description of an AUTOSAR included data type set (IncludedDataTypeSet). An IncludedDataTypeSet is defined as part of the internal behavior of a software component. It contains references to AUTOSAR data type definitions that are internal to a component and not present in the component interface descriptions. The referenced internal data type definitions can be shared among multiple software components, as described in Import and Reference Shared AUTOSAR Element Definitions. For information about IncludedDataTypeSet workflows, see Included Data Type Sets.

In Simulink®, you can configure an AUTOSAR internal data type to be exported in an ARXML IncludedDataTypeSet and generated in a C header file. In your AUTOSAR component model, create a data type object, use it to describe the internal data type, and map the data type to header file Rte_Type.h. For example:

  1. Create or open an AUTOSAR software component model in which blocks are used internally and are not part of the component model interface. For example, here is a model in which a Constant block is not connected to a model inport or outport.

  2. Create a data type object, Type3, in the base workspace or in a data dictionary. Select the Is alias check box.

    For AUTOSAR IncludedDataTypeSet export, Simulink supports these data types:

    • Numeric

    • Alias

    • Bus

    • Fixed-point

    • Enumerated

  3. Map the Type3 data type to header file Rte_Type.h. In the data type object dialog box, Code Generation tab, set Header file to Rte_Type.h. Click Apply.

  4. To reference Type3 in the model, enter Type3 in the Constant block parameter field Output data type.

    Type3 is internal to the component and is not exported in component interface descriptions. Because you mapped it to header file Rte_Type.h, it is exported in an IncludedDataTypeSet description.

  5. Build the model. In the exported ARXML, inside the description of the component internal behavior, an IncludedDataTypeSet description references the internal data type.

    <INCLUDED-DATA-TYPE-SETS>
        <INCLUDED-DATA-TYPE-SET>
            <DATA-TYPE-REFS>
                <DATA-TYPE-REF DEST="APPLICATION-PRIMITIVE-DATA-TYPE">
                  /Control_pkg/Control_dt/ApplDataTypes/Type3
                </DATA-TYPE-REF>
            </DATA-TYPE-REFS>
        </INCLUDED-DATA-TYPE-SET>
    </INCLUDED-DATA-TYPE-SETS>

    The generated Rte_Type.h header file contains an entry for the internal data type.

    /* AUTOSAR Implementation data types, specific to software component */
    typedef sint16 Type1;
    typedef sint16 Type2;
    typedef sint16 Type3;
    typedef void* Rte_Instance;

Related Examples

More About