Main Content

setInterface

Set interface for port

    Description

    setInterface(port,interface) sets the interface for a port.

    example

    Examples

    collapse all

    Create a model and get the root architecture.

    model = systemcomposer.createModel("archModel");
    systemcomposer.openModel("archModel");
    rootArch = get(model,"Architecture");

    Add a component and add a port to the component.

    newComponent = addComponent(rootArch,"newComponent");
    newPort = addPort(newComponent.Architecture,"newPort","in");

    Add a data interface and set the interface for the port.

    newInterface = addInterface(model.InterfaceDictionary,"newInterface");
    setInterface(newPort,newInterface)

    Remove the data interface on the port.

    newPort.setInterface("")

    Input Arguments

    collapse all

    Interface to set, specified as a systemcomposer.interface.DataInterface, systemcomposer.ValueType, systemcomposer.interface.PhysicalInterface, or systemcomposer.interface.ServiceInterface object. Passing in an empty string or character vector removes the interface on the port.

    More About

    collapse all

    Version History

    Introduced in R2019a

    See Also

    Functions

    Objects

    Blocks

    Tools