After you create a Simulink® model that represents an AUTOSAR software component, the
ARXML description of the component can change independently. Using
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.
To update a model with AUTOSAR software component changes described in ARXML files:
Open a model for which you previously imported or exported ARXML files. This example
uses the example ARXML file
to create a
Controller model. The ARXML file is located at
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');
Issue MATLAB commands to import ARXML descriptions into the model and update the model with changes.
The imported ARXML descriptions must contain the AUTOSAR software component mapped by the model.
For example, the following commands update the
with changes from ARXML file
ThrottlePositionControlComposition_updated.arxml. The ARXML file is
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.
Examine the report.
Verify that the ARXML importer has updated the model content and configuration based on the ARXML changes.
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.
Optionally, use the Find field to search for a term. You can quickly navigate to specific elements or other strings of interest.
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.
An ARXML update operation generates an AUTOSAR Update Report in HTML format. The report displays change information in sections:
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.
The AUTOSAR Update Report section Automatic Workspace Changes lists Simulink data object additions and property updates made by the importer. For example:
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.
The AUTOSAR Update Report section Automatic AUTOSAR Element Changes lists AUTOSAR element additions and property updates made by the importer. For example: