Contenu principal

autosar.arch.Component

R2026b

AUTOSAR software component in architecture model

    Description

    An autosar.arch.Component object represents an AUTOSAR software component in an AUTOSAR Blockset architecture model.

    Creation

    Create an autosar.arch.Component object by using the addComponent function to add a component to an autosar.arch.Model or autosar.arch.Composition object.

    comp = addComponent(archModel,"MySWC")
    comp = addComponent(archModel,"MySWC",Kind="SensorActuator")
    comp =
    
      Component with properties:
    
                  Name: 'MySWC'
        SimulinkHandle: 5.0002
                Parent: [1×1 autosar.arch.Model]
                  Kind: 'SensorActuator'
                 Ports: [0×0 autosar.arch.CompPort]
         ReferenceName: ''

    Properties

    expand all

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

    Data Types: char | string

    This property is read-only.

    Simulink block handle, represented as a double.

    Data Types: double

    Parent architecture element that contains the component, represented as an autosar.arch.Model or autosar.arch.Composition object.

    This property is read-only.

    Type of AUTOSAR software component, represented as "Application", "ComplexDeviceDriver", "EcuAbstraction", "SensorActuator", or "ServiceProxy".

    For models configured for the AUTOSAR Adaptive Platform, the value is "AdaptiveApplication". This property is set when you use the Kind name-value argument when creating the component using the addComponent function.

    Data Types: char

    Component ports, represented as an array of autosar.arch.CompPort objects.

    This property is read-only.

    Name of linked behavior model, represented as a character vector. The character vector is empty when no behavior model is linked.

    Data Types: char

    Object Functions

    addPortAdd port to AUTOSAR component, parameter component, composition, or architecture model
    createModelCreate AUTOSAR architecture model for composition or Simulink behavior model for component
    linkToModelLink AUTOSAR architecture component or composition to Simulink implementation model
    exportExport ARXML, ASAP2 files from AUTOSAR Blockset architecture models, and generate component code
    findFind AUTOSAR architecture, composition, component, parameter component and elements
    importFromARXMLImport compositions and components from ARXML files into AUTOSAR architecture model
    destroyRemove and delete AUTOSAR architecture element

    Examples

    collapse all

    This example shows how to add a component to an AUTOSAR software architecture, configure its ports, and create a linked behavior model.

    Create an architecture model and add a sensor actuator component.

    archModel = autosar.arch.createModel("MyArchModel");
    sensorSWC = addComponent(archModel,"SensorSWC",Kind="SensorActuator");

    Add a sender port to the component.

    sndPort = addPort(sensorSWC,"Sender","SensorData");

    Create a behavior model for the component.

    createModel(sensorSWC);

    Verify the linked model name.

    sensorSWC.ReferenceName
    ans =
    
        'SensorSWC'

    Version History

    Introduced in R2021a