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.importer
functionupdateModel
, 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:
Open a model for which you previously imported or exported ARXML files. This example uses the example ARXML file
ThrottlePositionControlComposition.arxml
to create aController
model. The ARXML file is located at
, which is on the default MATLAB®search path.matlabroot
/examples/autosarblockset/data% Create and open AUTOSAR controller component modelar = 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.
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 fileThrottlePositionControlComposition_updated.arxml
. The ARXML file is located at
, which is on the default MATLAB search path.matlabroot
/examples/autosarblockset/data% 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.
Examine the report.
Verify that the ARXML importer has updated the model content and configuration based on the ARXML changes.
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.
Optionally, use theFindfield 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
函数与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
- Import AUTOSAR XML Descriptions Into Simulink
- Import AUTOSAR Component to Simulink
- Import AUTOSAR Composition to Simulink
- Configure AUTOSAR Code Generation