Main Content

autosar.arch.ParameterPort

AUTOSAR software parameter component port

Since R2025a

    Description

    An autosar.arch.ParameterPort object describes an AUTOSAR parameter software component port in an AUTOSAR Blockset architecture model.

    Creation

    Create an autosar.arch.ParameterPort object by using the addPort function to add a port to an AUTOSAR parameter software component, represented by an autosar.arch.ParameterComponent object.

    parameterPort = addPort(parameterComponent,"ParameterSender",...
        "ParameterPort")
    autosar.arch.ParameterPort objects do not appear in the modeling canvas. Use the programmatic interface to interact with these objects. When you generate code, autosar.arch.ParameterPort descriptions are in the generated ARXML files.

    Properties

    expand all

    Name of parameter port, specified as a character vector or string scalar.

    Parameter software component that owns the port, represented as an autosar.arch.ParameterComponent object.

    Object Functions

    destroyRemove and delete AUTOSAR architecture element

    Examples

    collapse all

    Reference a component model in an AUTOSAR architecture, add a parameter software component, and generate code containing descriptions of the parameter software component, interface, connectors, and ports.

    Create an AUTOSAR architecture model by using the createModel function. Load example model autosar_swc_parameter.

    archModel = autosar.arch.createModel("AUTOSARArchitecture");
    load_system("autosar_swc_parameter");

    Add a component to the architecture model using the addComponent function.

    component = addComponent(archModel,"SensorComponent", ...
        Kind="SensorActuator");

    Link the component model autosar_swc_parameter to the component by using the linkToModel function.

    linkToModel(component,"autosar_swc_parameter");

    Add ports to the architecture model canvas and connect the architecture to the component.

    addPort(archModel,"Sender","SenderPort");
    addPort(archModel,"Receiver","ReceivePort");
    connect(archModel,archModel.Ports(1),component.Ports(1));
    connect(archModel,archModel.Ports(2),component.Ports(2));

    Add a parameter software component of type ParameterSender to the architecture model.

    parameterComponent = addComponent(archModel,"ParameterProvider",...
        Kind="ParameterComponent")
    parameterComponent = 
      ParameterComponent with no properties.
    
          Name: 'ParameterProvider'
        Parent: [1×1 autosar.arch.Model]
         Ports: [0×0 autosar.arch.ParameterPort]
    

    Add a parameter sender port to the parameter component. This port must be named ParameterPort to match the name of the ParameterReceiver port already present in the component model. Save the architecture.

    paramPort = addPort(parameterComponent,"ParameterSender",...
        "ParameterPort")
    save(archModel);
    paramPort = 
      ParameterPort with properties:
    
          Name: 'ParameterPort'
        Parent: [1×1 autosar.arch.ParameterComponent]
    

    Generate code by using the export function.

    evalc("export(archModel)");

    Inspecting the generated code shows the parameter software component interfaces, ports, and connectors. Since the names and initial values of the parameter ports match, connector descriptions are included in the generated ARXML files.

    <CONNECTORS>
      <ASSEMBLY-SW-CONNECTOR UUID="bcdfdb40-a9ee-5e0b-2389-caf35247273b">
          <SHORT-NAME>ParameterProvider_ParameterPort_SensorComponent_ParameterPort</SHORT-NAME>
          <PROVIDER-IREF>
              <CONTEXT-COMPONENT-REF DEST="SW-COMPONENT-PROTOTYPE">/Components/AUTOSARArchitecture/ParameterProvider</CONTEXT-COMPONENT-REF>
              <TARGET-P-PORT-REF DEST="P-PORT-PROTOTYPE">/Components/ParameterProvider/ParameterPort</TARGET-P-PORT-REF>
          </PROVIDER-IREF>
          <REQUESTER-IREF>
              <CONTEXT-COMPONENT-REF DEST="SW-COMPONENT-PROTOTYPE">/Components/AUTOSARArchitecture/SensorComponent</CONTEXT-COMPONENT-REF>
              <TARGET-R-PORT-REF DEST="R-PORT-PROTOTYPE">/Components/ASWC/ParameterPort</TARGET-R-PORT-REF>
          </REQUESTER-IREF>
      </ASSEMBLY-SW-CONNECTOR>
    

    Limitations

    • AUTOSAR architecture models can only have one parameter software component.

    • AUTOSAR parameter software components must exist at the top level of an architecture modeling hierarchy.

    • Parameter software component ports must have the same name as mapped parameter receiver ports that exist in at least one of the component models in an architecture model. When these port names match, descriptions of their connectors are included in exported ARXML files. For more information, see Configure AUTOSAR Port Parameters for Communication with Parameter Software Component.

    Version History

    Introduced in R2025a