Main Content

addDataInterface

Add data interface to Architectural Data section of Simulink data dictionary

Since R2023b

    Description

    example

    interfaceObj = addDataInterface(archDataObj,interfaceName) adds a data interface with the specified name to the data dictionary and returns the interface object that represents the interface.

    Examples

    collapse all

    To add a data interface for the specified bus object, use the addDataInterface function. For an example that shows more of the workflow for related functions, see Create Architectural Data Object and Use It to Configure Architectural Data.

    Add a data interface and create an object representing the interface using the addDataInterface function.

    dataInterface1 = addDataInterface(archDataObj,"DataInterface");
     

    You can add elements to the data interface using the addElement function.

    dataElm1 = addElement(dataInterface1,"DE1");
    dataElm1.Type = myAliasType1;
     
    dataElm2 = addElement(dataInterface1,"DE2");
    dataElm2.Type = myAliasType2;
    dataElm2.Dimensions = '4';
    dataElm2.Description = "I am a data element with DataType = array of struct type";
     
    dataElm3 = addElement(dataInterface1,"DE3");
    dataElm3.Type.DataType = 'single';
    dataElm3.Type.Dimensions = '10';
    dataElm3.Type.Minimum = '-5'; 

    Input Arguments

    collapse all

    Architectural data specified as a Simulink.dictionary.ArchitecturalData object.

    Name of the data interface, specified as a character vector or string scalar.

    Output Arguments

    collapse all

    Data interface object, returned as a Simulink.dictionary.archdata.DataInterface object.

    Version History

    Introduced in R2023b