Update Architectural Data Section of Data Dictionary from ARXML
In Simulink®, you can import AUTOSAR architectural data such as interfaces and data types from
AUTOSAR XML (ARXML) files. You use the ARXML importer, which is implemented as an arxml.importer
object. For more information, see AUTOSAR ARXML Importer.
To import ARXML software description files into Simulink, first call the arxml.importer
function. For example:
ar = arxml.importer("ThrottlePositionController.arxml")
To support the round trip of AUTOSAR elements between an AUTOSAR authoring tool (AAT) and the Simulink model-based design environment, ARXML import preserves imported AUTOSAR XML file structure, elements, and universal unique identifiers (UUIDs) for ARXML export. For more information, see Round-Trip Preservation of AUTOSAR XML File Structure and Element Information.
To configure ARXML export options, see Configure AUTOSAR XML Options.
Import Architectural Data to Data Dictionary from ARXML
Import AUTOSAR XML descriptions of architectural data such as interfaces and data types to an existing data dictionary. You link the updated data dictionary to component or composition models. You can continuously update the Architectural Data section of data dictionaries with content from ARXML files without having a Simulink model linked to the data dictionary.
You can import AUTOSAR XML descriptions of interfaces and data types by opening a data dictionary in the Architectural Data Editor, clicking the Import button , and then selecting ARXML.
This example programmatically creates and updates a data dictionary to contain architectural data from an imported ARXML file.
Create a data dictionary and
Simulink.dictionary.ArchitecturalData
objectarchDataObj
.dictName = "myDictionary.sldd"; archDataObj = Simulink.dictionary.archdata.create(dictName)
archDataObj = ArchitecturalData with properties: DictionaryFileName: 'myDictionary.sldd' Interfaces: [0×0 Simulink.dictionary.archdata.DataInterface] DataTypes: [0×0 Simulink.dictionary.archdata.DataType] Constants: [0×0 Simulink.dictionary.archdata.Constant]
Import the ARXML file
ThrottlePositionController.arxml
by usingarxml.importer
.arxmlObj = arxml.importer("TPCInterfacesAndDatatypes.arxml")
arxmlObj = The file "C:\work\TPCInterfacesAndDatatypes.arxml" contains: 1 Application-Software-Component-Type: '/Company/Components/Controller'
Add an AUTOSAR Classic platform mapping to the data dictionary. Save the dictionary and then update the contents by using the
updateArchitecturalData
function.autosarMap = addPlatformMapping(archDataObj,"AUTOSARClassic"); save(archDataObj) updateArchitecturalData(arxmlObj,dictName)
### Saving original dictionary as myDictionary_backup.sldd ### Creating HTML report myDictionary_update_report.html
The AUTOSAR Update Report opens and displays the changes made to the Architectural Data section of the data dictionary.
See Also
arxml.importer
| Simulink.dictionary.ArchitecturalData
Related Examples
- Import AUTOSAR Component to Simulink
- Import AUTOSAR Composition to Simulink
- Update AUTOSAR Software Component
- Import and Reference Shared AUTOSAR Element Definitions
- Import AUTOSAR Package into Component Model
- Configure AUTOSAR XML Options
- Round-Trip Preservation of AUTOSAR XML File Structure and Element Information