Main Content

export

Export AUTOSAR architecture model ARXML and generate component code

Description

example

export(archCCM) exports ARXML descriptions from AUTOSAR component, composition, or architecture model archCCM. The function also generates code for Simulink® implementation models linked by AUTOSAR components within the export scope. 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 pair arguments. For example, you can specify a ZIP file in which generated files are packaged.

Examples

collapse all

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

% Load AUTOSAR architecture model
modelName = 'autosar_tpc_composition';
addpath(fullfile(matlabroot,'/examples/autosarblockset/main'));
archModel = autosar.arch.loadModel(modelName);
% Export composition XML descriptions and generate component code
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';
addpath(fullfile(matlabroot,'/examples/autosarblockset/main'));
archModel = autosar.arch.loadModel(modelName);
% Export nested Sensors composition
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';
addpath(fullfile(matlabroot,'/examples/autosarblockset/main'));
archModel = autosar.arch.loadModel(modelName);
% Export ARXML descriptions and code into ZIP file
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';
addpath(fullfile(matlabroot,'/examples/autosarblockset/main'));
archModel = autosar.arch.loadModel(modelName);
% Export ECU extract into composition folder
export(archModel,'ExportECUExtract',true);

Input Arguments

collapse all

AUTOSAR component, composition, or architecture model for which to export ARXML descriptions and generate component code. 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.

Example: archModel

Name-Value Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

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 Composition 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'

Introduced in R2020a