Main Content

export

Export ARXML, ASAP2 files from AUTOSAR Blockset architecture models, and generate component code

Description

export(archCCM) exports ARXML descriptions from AUTOSAR the component, composition, or architecture model archCCM. The export function also generates code for Simulink® implementation models linked by AUTOSAR components within the export scope and exports an ASAP2 file for the component models. The containing architecture model must be open or loaded. The archCCM argument is a component, composition, or architecture model handle returned by a previous call to addComponent, addComposition, autosar.arch.createModel, or autosar.arch.loadModel.

example

export(archCCM,Name=Value) specifies additional export options with one or more name-value arguments. For example, to package the generated files into a ZIP file, specify the filename with the name-value argument PackageCodeAndARXML.

example

Examples

collapse all

Export composition XML descriptions and generate component code for an AUTOSAR architecture model.

Load AUTOSAR architecture model

modelName = "autosar_tpc_composition";
archModel = autosar.arch.loadModel(modelName);

Export composition XML descriptions and generate component code

evalc("export(archModel)");

Export XML descriptions and generate component code for a composition nested in an AUTOSAR architecture model.

Load AUTOSAR architecture model

modelName = "autosar_tpc_composition";
archModel = autosar.arch.loadModel(modelName);

Export nested Sensors composition

evalc("export(archModel.Compositions(1))");

Export XML descriptions and generate component code for an AUTOSAR architecture model. In the PackageCodeAndArxml value argument, specify the name of a ZIP file in which to package the generated files.

Load AUTOSAR architecture model.

modelName = "autosar_tpc_composition";
archModel = autosar.arch.loadModel(modelName);

Export ARXML descriptions and code into ZIP file.

evalc('export(archModel,PackageCodeAndARXML="myArchModel.zip")');

Export composition XML descriptions and generate component code for an AUTOSAR architecture model. As part of composition XML export, generate an ECU extract into the file System.arxml, which is located in the composition folder. The ECU extract for example model autosar_tpc_composition maps software components from both the top-level composition and a nested Sensors composition to one ECU.

Load AUTOSAR architecture model

modelName = "autosar_tpc_composition";
archModel = autosar.arch.loadModel(modelName);

Export ECU extract into composition folder

evalc("export(archModel,ExportECUExtract=true)");

Export composition XML descriptions and generate component code for an AUTOSAR architecture model. As part of the composition XML export, export ASAP2 file for the referenced component models and save them in a folder named asap2.

Load the AUTOSAR architecture model.

modelName = "autosar_tpc_composition";
archModel = autosar.arch.loadModel(modelName);

Export and save ASAP2 file.

evalc("export(archModel,ExportASAP2File=true)");

Input Arguments

collapse all

AUTOSAR component, composition, or architecture model to export ARXML descriptions and generate component code for. The argument is a component, composition, or architecture model handle returned by a previous call to addComponent, addComposition, autosar.arch.createModel, or autosar.arch.loadModel.

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.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: PackageCodeAndARXML="SensorsComposition.zip" specifies the name of a ZIP file that packages the generated files.

As part of XML export, option to export an ECU extract into the file System.arxml, which is located in the composition folder, specified as true or false. The ECU extract for a classic composition or architecture model maps software components from the top composition and any nested compositions to one ECU. For more information, see Export AUTOSAR Architecture ECU Extract.

Example: ExportECUExtract=true

Data Types: logical

Full path of the folder for ARXML description files, specified as a character vector or string scalar

Example: ExportedARXMLFolder='C:\temp\arxml'

Data Types: char | string

Option to export client-server connectors that describe the calls between function callers and global Simulink functions across components in an AUTOSAR architecture model, specified as true or false.

Connectors corresponding to interfaces are not exported to ARXML when both of these conditions are met:

  • ExportUnmodeledClientServerConnectors is set to true.

  • The interface is designed for Basic Software, as indicated when the IsService property is set to true.

Example: ExportUnmodeledClientServerConnectors=true

Data Types: logical

Name of ZIP file in which to package the generated files, including generated code and exported ARXML descriptions specified as a character vector or string scalar.

Example: PackageCodeAndARXML="SensorsComposition.zip"

Data Types: char | string

Option to export ASAP2 files while exporting the ARXML and generating component code, specified as true or false. The exported ASAP2 files are saved in a folder named asap2. For more information, see Generate and Package ASAP2 File.

Note

This name-value argument is not supported on macOS platform.

Example: ExportASAP2File=true

Data Types: logical

Option to open the architecture export report when exporting an AUTOSAR architecture model, specified as "on" or "off".

  • "on" — The report opens.

  • "off" — The report does not open.

Example: export(arch,OpenReport="on")

Version History

Introduced in R2020a

expand all