Main Content

Import AUTOSAR Software Component Updates

After you create a Simulink® model that represents an AUTOSAR software component, the ARXML description of the component can change independently. Using arxml.importer function updateModel, 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 file ThrottlePositionControlComposition.arxml to create a Controller model. The ARXML file is located at matlabroot/examples/autosarblockset/data, which is on the default MATLAB® search path.

    % Create and open AUTOSAR controller component model
    ar = 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 the Controller model with changes from ARXML file ThrottlePositionControlComposition_updated.arxml. The ARXML file is located at matlabroot/examples/autosarblockset/data, which is on the default MATLAB search path.

    % Update AUTOSAR controller component model
    ar2 = arxml.importer('ThrottlePositionControlComposition_updated.arxml');
    updateModel(ar2,'Controller');
    ### Updating model Controller
    ### Saving original model as Controller_backup.slx
    ### Creating HTML report Controller_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, click compare models to 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 the Find field 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 the updateModel function with the same ARXML files.

For live-script update examples, see Import AUTOSAR Component to Simulink and Import 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 section Automatic Model Changes lists 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 section Automatic Workspace Changes lists Simulink data object additions and property updates made by the importer. For example:

Required Manual Model Changes

The AUTOSAR Update Report section Required Manual Model Changes lists 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 section Automatic AUTOSAR Element Changes lists AUTOSAR element additions and property updates made by the importer. For example:

See Also

Related Examples

More About