Contenido principal

autosar.api.export

Export AUTOSAR XML, ASAP2 file, and generate component code from architecture model

For exporting AUTOSAR XML, ASAP2 file, and generating component code from an architecture model, R2020a introduced the architecture function export. Use the export function instead of autosar.api.export. For more information, see Configure AUTOSAR Architecture Model Programmatically and the export reference page.

Description

autosar.api.export(systemPath) exports ARXML descriptions from a specified root architecture model, composition, or component in the context of an open AUTOSAR architecture model. The function also generates code for referenced component models in the specified system path and exports ASAP2 file for the component models.

example

autosar.api.export(systemPath,Name,Value) specifies additional export options with one or more Name,Value pair arguments. For example, you can specify a ZIP file in which generated files are packaged.

example

Examples

collapse all

Export composition XML descriptions and generate component code for an AUTOSAR architecture model. In the system path argument, specify the name of the root architecture model.

open_system('autosar_tpc_composition');
autosar.api.export(hModel);

Export XML descriptions and generate code for component Ctrl in an AUTOSAR architecture model. In the system path argument, specify the path to the component block.

open_system('autosar_tpc_composition');
autosar.api.export('autosar_tpc_composition/Ctrl');

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

open_system('autosar_tpc_composition');
autosar.api.export('autosar_tpc_composition/Sensors',...
    'PackageCodeAndARXML','SensorsComposition.zip');

Export composition XML descriptions and generate component code for or 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.

open_system('autosar_tpc_composition');
autosar.api.export(hModel,'ExportECUExtract',true);

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

open_system('autosar_tpc_composition');
autosar.api.export(hModel,'ExportASAP2File',true);

Input Arguments

collapse all

Path to a root architecture model, composition, or component for which to export AUTOSAR XML descriptions and generate component code.

Example: 'autosar_tpc_composition/Sensors/Monitor'

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, generate an ECU extract into the file System.arxml, which is located in the composition folder. The ECU extract for a 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

Full path to a folder in which to place exported ARXML description files.

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

Name of a ZIP file in which to package the generated files, including generated code and exported ARXML descriptions.

Example: 'PackageCodeAndARXML','SensorsComposition.zip'

Export ASAP2 file while exporting the ARXML and generating component code. The exported ASAP2 file is packed into a folder named asap2. For more information, see Generate and Package ASAP2 File.

Example: 'ExportASAP2File',true

Version History

Introduced in R2019b