Main Content

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 Architectural Data Editor toolstrip. ARXML is selected from the Import menu., and then selecting ARXML.

ARXML file selection from Import from file button.

This example programmatically creates and updates a data dictionary to contain architectural data from an imported ARXML file.

  1. Create a data dictionary and Simulink.dictionary.ArchitecturalData object archDataObj.

    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]
    
  2. Import the ARXML file ThrottlePositionController.arxml by using arxml.importer.

    arxmlObj = arxml.importer("TPCInterfacesAndDatatypes.arxml")
    
    arxmlObj =
    
    The file "C:\work\TPCInterfacesAndDatatypes.arxml" contains:
      1 Application-Software-Component-Type:
        '/Company/Components/Controller'
    
  3. 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.

    AUTOSAR Update Report for myDictionary.sldd.

See Also

|

Related Examples

More About