Main Content

updateModel

Update AUTOSAR model or architecture with ARXML changes

Description

updateModel(ar,modelName) updates the specified open model or architecture with changes found in the AUTOSAR XML (ARXML) files associated with the arxml.importer object ar. The ARXML files must contain the AUTOSAR software component mapped by the model, and must be suitable for code generation.

When comparing the current version of the ARXML file with the previous version, the comparison routine applies these rules in this order:

  1. If elements have the same UUID and type, then the elements match. The function does not update the model.

  2. If elements have different UUIDs, then the elements do not match. The function updates the model with the ARXML change.

  3. If elements have the same qualified name, then the elements match. The function does not update the model.

  4. Otherwise, elements do not match. The function updates the model with the ARXML changes.

The updater generates and opens a report that details the changes made to the model, and required changes that were not made by the function. You can control whether this report opens by using the OpenReport argument.

AUTOSAR package structure updates affect the stored AR-PACKAGE structure and are applied to future exports. Imported package structure updates do not affect the AUTOSAR Dictionary package path XML options. The XML package path options apply to AUTOSAR elements created in Simulink® rather than to imported elements.

This function is supported only for models and architectures configured for the AUTOSAR Classic Platform.

example

updateModel(___,Name=Value) specifies options using one or more name-value arguments. For example, to specify that the AUTOSAR Update Report opens when the update process is complete, set OpenReport to "on".

example

Examples

collapse all

Update model mySWC with the changes described in ARXML file updatedSWC.arxml, and then open the AUTOSAR Update Report.

open_system("mySWC")
ar = arxml.importer("updatedSWC.arxml");
updateModel(ar,"mySWC",OpenReport="on");
### Updating model mySWC
### Saving original model as mySWC_backup.slx
### Creating HTML report mySWC_update_report.html

Update an architecture model, myArchModel with the ARXML changes described in updatedArchModel.arxml, and then open the AUTOSAR Update Report.

arModel = autosar.arch.loadModel("ControllerArchitecture");
impObj = arxml.importer("ControllerArchitecture.arxml");
updateModel(impObj,arModel)
### Updating model autosar_tpc_controller_bus
### Saving original model as autosar_tpc_controller_bus_backup_1.slx
### Creating HTML report autosar_tpc_controller_bus_update_report.html
Updated model 'autosar_tpc_controller_bus' for component 1 of 1: /Components/autosar_tpc_controller_bus
### Saving original model as ControllerArchitecture_backup.slx
Updating composition 1 of 1: /Components/ControllerArchitecture
### Creating HTML report ControllerArchitecture_update_report.html 

Input Arguments

collapse all

Handle of an arxml.importer that contains AUTOSAR information previously imported from ARXML files.

Name of an open model or architecture to update with changes from ARXML files associated with an arxml.importer object, specified as a character vector or string scalar.

Example: "mySWC"

Name-Value Arguments

collapse all

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: updateModel(ar,"myModel",OpenReport="off")

Option to open the AUTOSAR Update Report after updating a model, specified as "on" or "off".

  • "on" — The report opens.

  • "off" — The report does not open.

Example: updateModel(ar,"myControllerModel",OpenReport="off")

Path to a predefined variant in the ARXML file, specified as a cell array of character vectors or a string array. A predefined variant describes a combination of system constant values among potentially multiple valid combinations to apply to an AUTOSAR software component. Use this argument to resolve variation points in the AUTOSAR software component at model creation time. If specified, the importer uses the predefined variant to initialize software system constant data that serves as input to control variation points.

For more information, see Control AUTOSAR Variants with Predefined Value Combinations.

Example: PredefinedVariant="/pkg/body/Variants/Senior"

Paths to one or more system constant value sets defined in the ARXML file. A system constant value set specifies a set of system constant values to apply to an AUTOSAR software component. Use this argument to resolve variation points in the AUTOSAR software component at model creation time. If specified, the importer uses the system constant value sets to initialize system constant data that serves as input to control variation points.

For more information, see Control AUTOSAR Variants with Predefined Value Combinations.

Example: SystemConstValueSets={'/pkg/body/SystemConstantValues/A','/pkg/body/SystemConstantValues/B'}

Limitations

You can branch ports to multiple runnable systems. If an ARXML update removes data access for some but not all runnables accessing the port, then the software does not update the model canvas and the AUTOSAR Update Report does not indicate a change. The connectors and ports on the affected runnable system must be removed manually.

More About

collapse all

Version History

Introduced in R2014a

expand all