主要内容

getArchPort

R2026b

Get architecture port corresponding to component or composition port

Description

archPort = getArchPort(compPort) returns the architecture port corresponding to the component or composition port specified by compPort. The architecture port is the port owned by the parent architecture of the component or composition.

example

Examples

collapse all

This example shows how to get the architecture port that corresponds to a component port in an AUTOSAR architecture model.

Create an architecture model, add a component, and add a receiver port to the component.

arch = autosar.arch.createModel("MyArchModel");
comp = addComponent(archModel,"MySWC");
compPort = addPort(comp,"Receiver","SensorInput");

Get the architecture port corresponding to the component port.

archPort = getArchPort(compPort)
archPort =

  ArchPort with properties:

              Name: 'SensorInput'
         Interface: []
              Kind: 'Receiver'
         Connected: 0
            Parent: [1×1 autosar.arch.Component]
    SimulinkHandle: 7.0003

Input Arguments

collapse all

Component or composition port, specified as an autosar.arch.CompPort object. Create ports by using the addPort function.

Output Arguments

collapse all

Architecture port corresponding to the specified component or composition port, returned as an autosar.arch.ArchPort object. The architecture port is the port owned by the parent architecture of the component or composition.

Version History

Introduced in R2021a