Main Content

getDestinationElement

Gets signal elements selected on destination port for connection

    Description

    example

    selectedElems = getDestinationElement(connector) gets selected signal elements on destination port for connection specified by connector.

    Examples

    collapse all

    Get the selected element on destination port for a connection.

    modelName = 'archModel';
    arch = systemcomposer.createModel(modelName); % Create model
    rootArch = get(arch,'Architecture'); % Get architecture
    
    newComponent = addComponent(rootArch,'Component1'); % Add component
    outPortComp = addPort(newComponent.Architecture,...
    'testSig','out'); % Create out-port on component
    outPortArch = addPort(rootArch,'testSig','out'); % Create out-port on architecture
    compSrcPort = getPort(newComponent,'testSig'); % Extract component port object
    archDestPort = getPort(rootArch,'testSig'); % Extract architecture port object
    
    interface = arch.InterfaceDictionary.addInterface('interface'); % Add interface
    interface.addElement('x'); % Create interface element
    archDestPort.setInterface(interface); % Set interface on architecture port
    
    conns = connect(compSrcPort,archDestPort,'DestinationElement','x'); % Connect ports
    elem = getDestinationElement(conns)
    elem =
    
      1×1 cell array
    
        {'x'}

    Input Arguments

    collapse all

    Connection between ports, specified as a systemcomposer.arch.Connector object.

    Output Arguments

    collapse all

    Selected signal element names, returned as a character vector.

    Data Types: char

    Introduced in R2020b