Main Content

exportDictionary

Export interface, data type, and platform-specific definitions from Architectural Data section of data dictionary

Since R2022b

Description

exportedFolder = exportDictionary(platformMapping) exports the content from a data dictionary mapped to the AUTOSAR Classic Platform to ARXML files and RTE stub header files. This operation creates a folder in the current folder that contains the output files.

example

exportedFolder = exportDictionary(platformMapping,Name=Value) in addition to the previous functionality specifies options using one or more name-value arguments. For example, to delete unreferenced AUTOSAR properties from the data dictionary and exported files set RemoveUnreferencedAUTOSARProperties to true.

example

Examples

collapse all

To export the AUTOSAR content of the data dictionary to ARXML and header files, use the exportDictionary function. For an example that shows more of the workflow for related functions, see Configure AUTOSAR Classic Data Interface and Properties in Data Dictionary.

Create or open a data dictionary and export the interface and data type definitions.

archDataObj = Simulink.dictionary.archdata.open("MyInterfaces.sldd");
platformMapping = addPlatformMapping(archDataObj,"AUTOSARClassic");
exportedFolder = exportDictionary(platformMapping)
### Exporting dictionary...
### Exported dictionary ARXML files are located in: C:\Users\myName\MyInterfaces.

exportedFolder =
    'C:\Users\myName\MyInterfaces'

Export only the referenced AUTOSAR properties in the data dictionary to ARXML and header files.

Create an architectural data object to interact with the Architectural Data section of an opened data dictionary.

archDataObj = Simulink.dictionary.archdata.open("dictionary.sldd");

Add an AUTOSAR Classic Platform mapping to the Architectural Data section.

platformMapping = addPlatformMapping(archDataObj,"AUTOSARClassic");

Export the data dictionary, removing any unreferenced AUTOSAR properties in the data dictionary.

exportedFolder = exportDictionary(platformMapping,RemoveUnreferencedAUTOSARProperties=true)
### Exporting dictionary...
### The following AUTOSAR properties are no longer derived from any interface elements 
or data types in the Architectural Data section of dictionary 'dictionary.sldd' and have been removed:
 
AUTOSAR/DataTypes/ApplDataTypes/ApplDataType2
AUTOSAR/DataTypes/Struct
### Exported dictionary ARXML files are located in: C:\Users\myName\dictionary.

exportedFolder =
    'C:\Users\myName\MyInterfaces'

The output lists the AUTOSAR properties that are removed as part of the export process. These properties are not present in the generated ARXML files. They are also removed from the Architectural Data section of the specified data dictionary, leaving the dictionary dirty. Either discard the changes to keep the removed AUTOSAR properties in the Architectural Data section, or save the dictionary to remove the AUTOSAR properties from the dictionary.

Input Arguments

collapse all

Platform mapping object, specified as an autosar.dictionary.ARClassicPlatformMapping object.

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: RemoveUnreferencedAUTOSARProperties=true removes any unreferenced AUTOSAR properties derived from the Architectural Data section.

Configuration set to apply to the exported data dictionary, specified as a Simulink.ConfigSet object.

Option to remove unreferenced AUTOSAR properties when exporting a data dictionary, specified as logical 1 (true) or 0 (false). Unreferenced AUTOSAR properties are properties that are not derived from interface elements or data types that exist in the Architectural Data section of a linked data dictionary.

When this name-value argument is specified as true or 1 the export process removes any unreferenced properties in the data dictionary associated with the autosar.dictinary.ARClassicPlatformMapping object specified by platformMapping and leaves the data dictionary dirty. The export process also removes unreferenced properties from models linked to the same data dictionary. To restore removed AUTOSAR properties, discard changes to the data dictionary.

Example: RemoveUnreferencedAUTOSARProperties=true

Data Types: logical

Output Arguments

collapse all

Full path of the folder containing the exported files from the data dictionary, specified as a string scalar or a character vector.

Exported files contained in export folder include ARXML files, which are named dictionaryname_datatypes.arxml and dictionaryname_interfaces.arxml, where dictionaryname is the name of the data dictionary, and a stub folder containing RTE header files. If the files already exist, exportDictionary overwrites them.

Example: 'arxmlFolder'

Version History

Introduced in R2022b

expand all