export
Export AUTOSAR architecture model ARXML, ASAP2 file, and generate component code
Since R2020a
Description
export(
exports ARXML
descriptions from AUTOSAR component, composition, or architecture model
archCCM
)archCCM
. The function also generates code for Simulink® implementation models linked by AUTOSAR components within the export scope and
exports 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
.
export(
specifies additional export options with one or more archCCM
,Name,Value
)Name,Value
pair
arguments. For example, you can specify a ZIP file in which generated files are
packaged.
Examples
Generate ARXML Descriptions and Code for Architecture Model
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
export(archModel);
Building component: autosar_tpc_actuator (1 out of 6) ### Starting build procedure for: autosar_tpc_actuator ### Generating XML files description for: autosar_tpc_actuator ### Successful completion of code generation for: autosar_tpc_actuator Build Summary Top model targets: Model Build Reason Status Build Duration ========================================================================================================== autosar_tpc_actuator Information cache folder or artifacts were missing. Code generated. 0h 0m 49.78s 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 53.573s Building component: autosar_tpc_controller (2 out of 6) ### Starting build procedure for: autosar_tpc_controller ### Generating XML files description for: autosar_tpc_controller ### Successful completion of code generation for: autosar_tpc_controller Build Summary Top model targets: Model Build Reason Status Build Duration ============================================================================================================ autosar_tpc_controller Information cache folder or artifacts were missing. Code generated. 0h 0m 29.557s 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 30.884s Building component: autosar_tpc_throttle_sensor_monitor (3 out of 6) ### Starting build procedure for: autosar_tpc_throttle_sensor_monitor ### Generating XML files description for: autosar_tpc_throttle_sensor_monitor ### Successful completion of code generation for: autosar_tpc_throttle_sensor_monitor Build Summary Top model targets: Model Build Reason Status Build Duration ========================================================================================================================= autosar_tpc_throttle_sensor_monitor Information cache folder or artifacts were missing. Code generated. 0h 0m 30.197s 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 31.251s Building component: autosar_tpc_pedal_sensor (4 out of 6) ### Starting build procedure for: autosar_tpc_pedal_sensor ### Generating XML files description for: autosar_tpc_pedal_sensor ### Successful completion of code generation for: autosar_tpc_pedal_sensor Build Summary Top model targets: Model Build Reason Status Build Duration ============================================================================================================== autosar_tpc_pedal_sensor Information cache folder or artifacts were missing. Code generated. 0h 0m 33.557s 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 35.785s Building component: autosar_tpc_throttle_sensor1 (5 out of 6) ### Starting build procedure for: autosar_tpc_throttle_sensor1 ### Generating XML files description for: autosar_tpc_throttle_sensor1 ### Successful completion of code generation for: autosar_tpc_throttle_sensor1 Build Summary Top model targets: Model Build Reason Status Build Duration ================================================================================================================== autosar_tpc_throttle_sensor1 Information cache folder or artifacts were missing. Code generated. 0h 0m 30.813s 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 33.162s Building component: autosar_tpc_throttle_sensor2 (6 out of 6) ### Starting build procedure for: autosar_tpc_throttle_sensor2 ### Generating XML files description for: autosar_tpc_throttle_sensor2 ### Successful completion of code generation for: autosar_tpc_throttle_sensor2 Build Summary Top model targets: Model Build Reason Status Build Duration ================================================================================================================== autosar_tpc_throttle_sensor2 Information cache folder or artifacts were missing. Code generated. 0h 0m 22.581s 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 23.532s Exporting dictionary: tpc_interfaces.sldd (1 out of 1) Exporting dictionary, please wait... Exported dictionary ARXML files are located in: /tmp/Bdoc24b_2725827_2558500/tpb951584e/autosarblockset-ex12133217/tpc_interfaces. Exporting composition: autosar_tpc_composition ### Generating XML description files for: autosar_tpc_composition ### Successful completion of export for: autosar_tpc_composition
Generate ARXML Descriptions and Code for Nested Composition
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
export(archModel.Compositions(1));
Building component: autosar_tpc_throttle_sensor_monitor (1 out of 4) ### Starting build procedure for: autosar_tpc_throttle_sensor_monitor ### Generating XML files description for: autosar_tpc_throttle_sensor_monitor ### Successful completion of code generation for: autosar_tpc_throttle_sensor_monitor Build Summary Top model targets: Model Build Reason Status Build Duration ========================================================================================================================= autosar_tpc_throttle_sensor_monitor Information cache folder or artifacts were missing. Code generated. 0h 0m 24.223s 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 25.468s Building component: autosar_tpc_pedal_sensor (2 out of 4) ### Starting build procedure for: autosar_tpc_pedal_sensor ### Generating XML files description for: autosar_tpc_pedal_sensor ### Successful completion of code generation for: autosar_tpc_pedal_sensor Build Summary Top model targets: Model Build Reason Status Build Duration ============================================================================================================== autosar_tpc_pedal_sensor Information cache folder or artifacts were missing. Code generated. 0h 0m 19.334s 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 20.127s Building component: autosar_tpc_throttle_sensor1 (3 out of 4) ### Starting build procedure for: autosar_tpc_throttle_sensor1 ### Generating XML files description for: autosar_tpc_throttle_sensor1 ### Successful completion of code generation for: autosar_tpc_throttle_sensor1 Build Summary Top model targets: Model Build Reason Status Build Duration ================================================================================================================== autosar_tpc_throttle_sensor1 Information cache folder or artifacts were missing. Code generated. 0h 0m 20.561s 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 21.286s Building component: autosar_tpc_throttle_sensor2 (4 out of 4) ### Starting build procedure for: autosar_tpc_throttle_sensor2 ### Generating XML files description for: autosar_tpc_throttle_sensor2 ### Successful completion of code generation for: autosar_tpc_throttle_sensor2 Build Summary Top model targets: Model Build Reason Status Build Duration ================================================================================================================== autosar_tpc_throttle_sensor2 Information cache folder or artifacts were missing. Code generated. 0h 0m 20.446s 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 21.275s Exporting dictionary: tpc_interfaces.sldd (1 out of 1) Exporting dictionary, please wait... Exported dictionary ARXML files are located in: /tmp/Bdoc24b_2725827_2558500/tpb951584e/autosarblockset-ex13803922/tpc_interfaces. Exporting composition: autosar_tpc_composition/Sensors ### Generating XML description files for: autosar_tpc_composition/Sensors ### Successful completion of export for: autosar_tpc_composition/Sensors
Generate ARXML Descriptions and Code In ZIP File
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.
export(archModel,"PackageCodeAndARXML","myArchModel.zip");
Building component: autosar_tpc_actuator (1 out of 6) ### Starting build procedure for: autosar_tpc_actuator ### Generating XML files description for: autosar_tpc_actuator ### Successful completion of code generation for: autosar_tpc_actuator Build Summary Top model targets: Model Build Reason Status Build Duration ========================================================================================================== autosar_tpc_actuator Information cache folder or artifacts were missing. Code generated. 0h 0m 23.024s 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 24.313s Building component: autosar_tpc_controller (2 out of 6) ### Starting build procedure for: autosar_tpc_controller ### Generating XML files description for: autosar_tpc_controller ### Successful completion of code generation for: autosar_tpc_controller Build Summary Top model targets: Model Build Reason Status Build Duration ============================================================================================================ autosar_tpc_controller Information cache folder or artifacts were missing. Code generated. 0h 0m 22.496s 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 23.698s Building component: autosar_tpc_throttle_sensor_monitor (3 out of 6) ### Starting build procedure for: autosar_tpc_throttle_sensor_monitor ### Generating XML files description for: autosar_tpc_throttle_sensor_monitor ### Successful completion of code generation for: autosar_tpc_throttle_sensor_monitor Build Summary Top model targets: Model Build Reason Status Build Duration ========================================================================================================================= autosar_tpc_throttle_sensor_monitor Information cache folder or artifacts were missing. Code generated. 0h 0m 21.952s 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 22.796s Building component: autosar_tpc_pedal_sensor (4 out of 6) ### Starting build procedure for: autosar_tpc_pedal_sensor ### Generating XML files description for: autosar_tpc_pedal_sensor ### Successful completion of code generation for: autosar_tpc_pedal_sensor Build Summary Top model targets: Model Build Reason Status Build Duration ============================================================================================================== autosar_tpc_pedal_sensor Information cache folder or artifacts were missing. Code generated. 0h 0m 20.653s 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 21.445s Building component: autosar_tpc_throttle_sensor1 (5 out of 6) ### Starting build procedure for: autosar_tpc_throttle_sensor1 ### Generating XML files description for: autosar_tpc_throttle_sensor1 ### Successful completion of code generation for: autosar_tpc_throttle_sensor1 Build Summary Top model targets: Model Build Reason Status Build Duration ================================================================================================================== autosar_tpc_throttle_sensor1 Information cache folder or artifacts were missing. Code generated. 0h 0m 21.836s 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 22.65s Building component: autosar_tpc_throttle_sensor2 (6 out of 6) ### Starting build procedure for: autosar_tpc_throttle_sensor2 ### Generating XML files description for: autosar_tpc_throttle_sensor2 ### Successful completion of code generation for: autosar_tpc_throttle_sensor2 Build Summary Top model targets: Model Build Reason Status Build Duration ================================================================================================================== autosar_tpc_throttle_sensor2 Information cache folder or artifacts were missing. Code generated. 0h 0m 27.242s 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 28.13s Exporting dictionary: tpc_interfaces.sldd (1 out of 1) Exporting dictionary, please wait... Exported dictionary ARXML files are located in: /tmp/Bdoc24b_2725827_2558500/tpb951584e/autosarblockset-ex37160044/tpc_interfaces. Exporting composition: autosar_tpc_composition ### Generating XML description files for: autosar_tpc_composition ### Successful completion of export for: autosar_tpc_composition
Generate ECU Extract for Architecture Model
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
export(archModel,'ExportECUExtract',true);
Building component: autosar_tpc_actuator (1 out of 6) ### Starting build procedure for: autosar_tpc_actuator ### Generating XML files description for: autosar_tpc_actuator ### Successful completion of code generation for: autosar_tpc_actuator Build Summary Top model targets: Model Build Reason Status Build Duration ========================================================================================================== autosar_tpc_actuator Information cache folder or artifacts were missing. Code generated. 0h 0m 25.392s 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 26.565s Building component: autosar_tpc_controller (2 out of 6) ### Starting build procedure for: autosar_tpc_controller ### Generating XML files description for: autosar_tpc_controller ### Successful completion of code generation for: autosar_tpc_controller Build Summary Top model targets: Model Build Reason Status Build Duration ============================================================================================================ autosar_tpc_controller Information cache folder or artifacts were missing. Code generated. 0h 0m 21.593s 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 22.862s Building component: autosar_tpc_throttle_sensor_monitor (3 out of 6) ### Starting build procedure for: autosar_tpc_throttle_sensor_monitor ### Generating XML files description for: autosar_tpc_throttle_sensor_monitor ### Successful completion of code generation for: autosar_tpc_throttle_sensor_monitor Build Summary Top model targets: Model Build Reason Status Build Duration ========================================================================================================================= autosar_tpc_throttle_sensor_monitor Information cache folder or artifacts were missing. Code generated. 0h 0m 22.794s 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 23.843s Building component: autosar_tpc_pedal_sensor (4 out of 6) ### Starting build procedure for: autosar_tpc_pedal_sensor ### Generating XML files description for: autosar_tpc_pedal_sensor ### Successful completion of code generation for: autosar_tpc_pedal_sensor Build Summary Top model targets: Model Build Reason Status Build Duration ============================================================================================================== autosar_tpc_pedal_sensor Information cache folder or artifacts were missing. Code generated. 0h 0m 21.187s 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 22.012s Building component: autosar_tpc_throttle_sensor1 (5 out of 6) ### Starting build procedure for: autosar_tpc_throttle_sensor1 ### Generating XML files description for: autosar_tpc_throttle_sensor1 ### Successful completion of code generation for: autosar_tpc_throttle_sensor1 Build Summary Top model targets: Model Build Reason Status Build Duration ================================================================================================================== autosar_tpc_throttle_sensor1 Information cache folder or artifacts were missing. Code generated. 0h 0m 24.713s 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 25.507s Building component: autosar_tpc_throttle_sensor2 (6 out of 6) ### Starting build procedure for: autosar_tpc_throttle_sensor2 ### Generating XML files description for: autosar_tpc_throttle_sensor2 ### Successful completion of code generation for: autosar_tpc_throttle_sensor2 Build Summary Top model targets: Model Build Reason Status Build Duration ================================================================================================================== autosar_tpc_throttle_sensor2 Information cache folder or artifacts were missing. Code generated. 0h 0m 23.014s 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 24.144s Exporting dictionary: tpc_interfaces.sldd (1 out of 1) Exporting dictionary, please wait... Exported dictionary ARXML files are located in: /tmp/Bdoc24b_2725827_2558500/tpb951584e/autosarblockset-ex51579616/tpc_interfaces. Exporting composition: autosar_tpc_composition ### Generating XML description files for: autosar_tpc_composition ### Successful completion of export for: autosar_tpc_composition
Generate ASAP2 File for Architecture Model
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
archCCM
— Component, composition, or architecture model
handle
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 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.
ExportECUExtract
— Export ECU extract
false
(default) | true
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 classic 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
ExportedARXMLFolder
— Folder location for exported ARXML files
character vector | string scalar
Full path to a folder in which to place exported ARXML description files.
Example: 'ExportedARXMLFolder','C:\temp\arxml'
ExportUnmodeledClientServerConnectors
— Whether to export client-server connectors
false
(default) | true
Enable code generation of client-server connectors that describe the calls between function callers and global Simulink functions across components in an AUTOSAR architecture model.
Example: 'ExportUnmodeledClientServerConnectors',
true
Data Types: logical
PackageCodeAndARXML
— Name of ZIP file in which to package generated files
character vector | string scalar
Name of a ZIP file in which to package the generated files, including generated code and exported ARXML descriptions.
Example: 'PackageCodeAndARXML','SensorsComposition.zip'
ExportASAP2File
— Export ASAP2 file
false
(default) | true
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.
Note
This Name-value argument is not supported on macOS platform.
Example: 'ExportASAP2File',true
Version History
Introduced in R2020aR2023b: Additional Name=Value Argument
Additional Name-value argument ExportASAP2File
is added to export
ASAP2 file for the architecture model while exporting ARXML descriptions and generating
component code.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)