Main Content

autosar.arch.ParameterComponent

AUTOSAR software parameter component

Since R2025a

    Description

    An autosar.arch.ParameterComponent object describes an AUTOSAR parameter software component in AUTOSAR Blockset.

    Creation

    Create an autosar.arch.ParameterComponent object by using the addComponent function to add a parameter component to an AUTOSAR architecture model object.

    parameterComponent = addComponent(archModel,"ParameterSWC",...
        Kind="ParameterComponent")
    autosar.arch.ParameterComponent objects do not appear in the modeling canvas. Use the programmatic interface to interact with these objects. When you generate code, the autosar.arch.ParameterComponent descriptions are in the generated ARXML files.

    Properties

    expand all

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

    Example: "AUTOSARParameterComponent"

    Data Types: char | string

    AUTOSAR architecture model that contains the parameter software component, represented as an autosar.arch.Model object.

    Parameter software component ports, specified as an array of autosar.arch.ParameterPort objects.

    Object Functions

    addPortAdd port to AUTOSAR component, parameter component, composition, or architecture model
    destroyRemove and delete AUTOSAR architecture element
    findFind AUTOSAR architecture, composition, component, parameter component and elements

    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 by 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. Because 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 have only 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