Main Content

makeOwnedInterfaceShared

Convert owned interface to shared interface

Since R2022a

    Description

    makeOwnedInterfaceShared(archPort,newInterfaceName) converts an owned interface on the port archPort into a shared interface with name newInterfaceName in the data dictionary used in the architecture model.

    example

    Examples

    collapse all

    Create an architecture port on a component in an architecture model.

    modelName = "archModel";
    model = systemcomposer.createModel(modelName);
    systemcomposer.openModel(modelName);
    comp = model.Architecture.addComponent("Component1");
    inport = comp.Architecture.addPort("InBus","in");

    Add a shared interface to the model.

    interfaceDict = model.InterfaceDictionary;
    SharedInterface = interfaceDict.addInterface("SharedInterface");
    SharedInterface.addElement("SharedElem_X");
    SharedInterface.addElement("SharedElem_Y");

    Create an owned interface on the architecture port.

    ownedInterface = inport.createInterface("DataInterface");
    ownedInterface.removeElement("elem0");
    elemA = ownedInterface.addElement("A");
    ownedInterface.addElement("B",DataType="single",Dimensions="1",...
    Units="m",Complexity="real",Maximum="200",Minimum="0",...
    Description="Length value");

    Convert the owned interface to a shared interface.

    convertedInterface = inport.makeOwnedInterfaceShared("convertedInterface")
    convertedInterface = 
    
      DataInterface with properties:
    
              Owner: [1×1 systemcomposer.interface.Dictionary]
               Name: 'convertedInterface'
           Elements: [1×2 systemcomposer.interface.DataElement]
              Model: [1×1 systemcomposer.arch.Model]
               UUID: '59a41ae1-e04d-479c-81e6-881230bad662'
        ExternalUID: ''

    Input Arguments

    collapse all

    Architecture port, specified as a systemcomposer.arch.ArchitecturePort object.

    New interface name, specified as a character vector or string.

    Data Types: char | string

    More About

    collapse all

    Version History

    Introduced in R2022a

    See Also

    Functions

    Objects

    Blocks

    Tools