Main Content

Import AUTOSAR Software Component Updates

After you create a Simulink®model that represents an AUTOSAR software component or composition, the ARXML description of the component or composition can change independently. Usingarxml.importerfunctionupdateModel, you can import the modified ARXML description and update the model to reflect the changes. The update generates an HTML report that details automatic updates applied to the model, and additional manual changes that you must perform.

Update Model with AUTOSAR Software Component Changes

To update a model with AUTOSAR software component changes described in ARXML files:

  1. Open a model for which you previously imported or exported ARXML files. This example uses the example ARXML fileThrottlePositionControlComposition.arxmlto create aControllermodel. The ARXML file is located atmatlabroot/examples/autosarblockset/data, which is on the default MATLAB®search path.

    % Create and open AUTOSAR controller component modelar = arxml.importer('ThrottlePositionControlComposition.arxml'); createComponentAsModel(ar,'/Company/Components/Controller',...'ModelPeriodicRunnablesAs','AtomicSubsystem');
  2. Issue MATLAB commands to import ARXML descriptions into the model and update the model with changes.

    Note

    The imported ARXML descriptions must contain the AUTOSAR software component mapped by the model.

    For example, the following commands update theControllermodel with changes from ARXML fileThrottlePositionControlComposition_updated.arxml. The ARXML file is located atmatlabroot/examples/autosarblockset/data, which is on the default MATLAB search path.

    % Update AUTOSAR controller component modelar2 = arxml.importer('ThrottlePositionControlComposition_updated.arxml'); updateModel(ar2,'Controller');
    ### Updating model Controller ### Saving original model as Controller_backup.slx ### Creating HTML reportController_update_report.html

    The AUTOSAR Update Report opens.

  3. Examine the report.

    1. Verify that the ARXML importer has updated the model content and configuration based on the ARXML changes.

    2. Optionally, clickcompare modelsto compare the original model with the updated model. Tabular and graphical views of the differences open. You can click a changed element in the tabular view to navigate to a graphical view of the change.

    3. Optionally, use theFindfield to search for a term. You can quickly navigate to specific elements or other strings of interest.

  4. If the report lists required manual model changes, such as deleting a Simulink block, perform the required changes.

    If you make a required change to the model, further configuration could be required to pass validation. To see if more manual model changes are required, repeat the update procedure, rerunning theupdateModel函数与same ARXML files.

For live-script update examples, seeImport AUTOSAR Component to SimulinkandImport AUTOSAR Composition to Simulink.

AUTOSAR Update Report Section Examples

An ARXML update operation generates an AUTOSAR Update Report in HTML format. The report displays change information in sections:

Automatic Model Changes

The AUTOSAR Update Report sectionAutomatic Model Changeslists Simulink block additions, block property updates, and model parameter updates made by the importer. For example:

In the updated model, green highlighting identifies added blocks.

Automatic Workspace Changes

The AUTOSAR Update Report sectionAutomatic Workspace Changeslists Simulink data object additions and property updates made by the importer. For example:

Required Manual Model Changes

The AUTOSAR Update Report sectionRequired Manual Model Changeslists model changes, such as block deletions, that are required. For example:

In the updated model, red highlighting identifies the block to delete.

Automatic AUTOSAR Element Changes

The AUTOSAR Update Report sectionAutomatic AUTOSAR Element Changeslists AUTOSAR element additions and property updates made by the importer. For example:

See Also

Related Examples

More About