export
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.
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 built: Model Action Rebuild Reason ========================================================================================= autosar_tpc_actuator Code generated. Code generation information file does not exist. 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 21.209s 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 built: Model Action Rebuild Reason =========================================================================================== autosar_tpc_controller Code generated. Code generation information file does not exist. 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 11.022s 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 built: Model Action Rebuild Reason ======================================================================================================== autosar_tpc_throttle_sensor_monitor Code generated. Code generation information file does not exist. 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 12.772s 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 built: Model Action Rebuild Reason ============================================================================================= autosar_tpc_pedal_sensor Code generated. Code generation information file does not exist. 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 8.8041s Building component: autosar_tpc_throttle_sensor1 (5 out of 6) ### Starting build procedure for: autosar_tpc_throttle_sensor1 Model "autosar_tpc_throttle_sensor1" contains deprecated AUTOSAR 3.x platform types that will be automatically converted to AUTOSAR 4.x platform type names in future releases. To convert from AUTOSAR 3.x names to AUTOSAR 4.x platform type names directly, use the 'PlatformTypeNames' XML Option. ### Generating XML files description for: autosar_tpc_throttle_sensor1 ### Successful completion of code generation for: autosar_tpc_throttle_sensor1 Build Summary Top model targets built: Model Action Rebuild Reason ================================================================================================= autosar_tpc_throttle_sensor1 Code generated. Code generation information file does not exist. 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 12.787s Building component: autosar_tpc_throttle_sensor2 (6 out of 6) ### Starting build procedure for: autosar_tpc_throttle_sensor2 Model "autosar_tpc_throttle_sensor2" contains deprecated AUTOSAR 3.x platform types that will be automatically converted to AUTOSAR 4.x platform type names in future releases. To convert from AUTOSAR 3.x names to AUTOSAR 4.x platform type names directly, use the 'PlatformTypeNames' XML Option. ### Generating XML files description for: autosar_tpc_throttle_sensor2 ### Successful completion of code generation for: autosar_tpc_throttle_sensor2 Build Summary Top model targets built: Model Action Rebuild Reason ================================================================================================= autosar_tpc_throttle_sensor2 Code generated. Code generation information file does not exist. 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 10.441s 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 built: Model Action Rebuild Reason ======================================================================================================== autosar_tpc_throttle_sensor_monitor Code generated. Code generation information file does not exist. 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 12.388s 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 built: Model Action Rebuild Reason ============================================================================================= autosar_tpc_pedal_sensor Code generated. Code generation information file does not exist. 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 8.9077s Building component: autosar_tpc_throttle_sensor1 (3 out of 4) ### Starting build procedure for: autosar_tpc_throttle_sensor1 Model "autosar_tpc_throttle_sensor1" contains deprecated AUTOSAR 3.x platform types that will be automatically converted to AUTOSAR 4.x platform type names in future releases. To convert from AUTOSAR 3.x names to AUTOSAR 4.x platform type names directly, use the 'PlatformTypeNames' XML Option. ### Generating XML files description for: autosar_tpc_throttle_sensor1 ### Successful completion of code generation for: autosar_tpc_throttle_sensor1 Build Summary Top model targets built: Model Action Rebuild Reason ================================================================================================= autosar_tpc_throttle_sensor1 Code generated. Code generation information file does not exist. 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 10.74s Building component: autosar_tpc_throttle_sensor2 (4 out of 4) ### Starting build procedure for: autosar_tpc_throttle_sensor2 Model "autosar_tpc_throttle_sensor2" contains deprecated AUTOSAR 3.x platform types that will be automatically converted to AUTOSAR 4.x platform type names in future releases. To convert from AUTOSAR 3.x names to AUTOSAR 4.x platform type names directly, use the 'PlatformTypeNames' XML Option. ### Generating XML files description for: autosar_tpc_throttle_sensor2 ### Successful completion of code generation for: autosar_tpc_throttle_sensor2 Build Summary Top model targets built: Model Action Rebuild Reason ================================================================================================= autosar_tpc_throttle_sensor2 Code generated. Code generation information file does not exist. 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 9.7356s 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 built: Model Action Rebuild Reason ========================================================================================= autosar_tpc_actuator Code generated. Code generation information file does not exist. 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 9.1769s 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 built: Model Action Rebuild Reason =========================================================================================== autosar_tpc_controller Code generated. Code generation information file does not exist. 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 10.127s 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 built: Model Action Rebuild Reason ======================================================================================================== autosar_tpc_throttle_sensor_monitor Code generated. Code generation information file does not exist. 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 9.9815s 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 built: Model Action Rebuild Reason ============================================================================================= autosar_tpc_pedal_sensor Code generated. Code generation information file does not exist. 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 8.9707s Building component: autosar_tpc_throttle_sensor1 (5 out of 6) ### Starting build procedure for: autosar_tpc_throttle_sensor1 Model "autosar_tpc_throttle_sensor1" contains deprecated AUTOSAR 3.x platform types that will be automatically converted to AUTOSAR 4.x platform type names in future releases. To convert from AUTOSAR 3.x names to AUTOSAR 4.x platform type names directly, use the 'PlatformTypeNames' XML Option. ### Generating XML files description for: autosar_tpc_throttle_sensor1 ### Successful completion of code generation for: autosar_tpc_throttle_sensor1 Build Summary Top model targets built: Model Action Rebuild Reason ================================================================================================= autosar_tpc_throttle_sensor1 Code generated. Code generation information file does not exist. 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 10.528s Building component: autosar_tpc_throttle_sensor2 (6 out of 6) ### Starting build procedure for: autosar_tpc_throttle_sensor2 Model "autosar_tpc_throttle_sensor2" contains deprecated AUTOSAR 3.x platform types that will be automatically converted to AUTOSAR 4.x platform type names in future releases. To convert from AUTOSAR 3.x names to AUTOSAR 4.x platform type names directly, use the 'PlatformTypeNames' XML Option. ### Generating XML files description for: autosar_tpc_throttle_sensor2 ### Successful completion of code generation for: autosar_tpc_throttle_sensor2 Build Summary Top model targets built: Model Action Rebuild Reason ================================================================================================= autosar_tpc_throttle_sensor2 Code generated. Code generation information file does not exist. 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 10.656s 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 built: Model Action Rebuild Reason ========================================================================================= autosar_tpc_actuator Code generated. Code generation information file does not exist. 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 9.4357s 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 built: Model Action Rebuild Reason =========================================================================================== autosar_tpc_controller Code generated. Code generation information file does not exist. 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 10.857s 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 built: Model Action Rebuild Reason ======================================================================================================== autosar_tpc_throttle_sensor_monitor Code generated. Code generation information file does not exist. 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 8.7246s 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 built: Model Action Rebuild Reason ============================================================================================= autosar_tpc_pedal_sensor Code generated. Code generation information file does not exist. 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 8.54s Building component: autosar_tpc_throttle_sensor1 (5 out of 6) ### Starting build procedure for: autosar_tpc_throttle_sensor1 Model "autosar_tpc_throttle_sensor1" contains deprecated AUTOSAR 3.x platform types that will be automatically converted to AUTOSAR 4.x platform type names in future releases. To convert from AUTOSAR 3.x names to AUTOSAR 4.x platform type names directly, use the 'PlatformTypeNames' XML Option. ### Generating XML files description for: autosar_tpc_throttle_sensor1 ### Successful completion of code generation for: autosar_tpc_throttle_sensor1 Build Summary Top model targets built: Model Action Rebuild Reason ================================================================================================= autosar_tpc_throttle_sensor1 Code generated. Code generation information file does not exist. 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 10.945s Building component: autosar_tpc_throttle_sensor2 (6 out of 6) ### Starting build procedure for: autosar_tpc_throttle_sensor2 Model "autosar_tpc_throttle_sensor2" contains deprecated AUTOSAR 3.x platform types that will be automatically converted to AUTOSAR 4.x platform type names in future releases. To convert from AUTOSAR 3.x names to AUTOSAR 4.x platform type names directly, use the 'PlatformTypeNames' XML Option. ### Generating XML files description for: autosar_tpc_throttle_sensor2 ### Successful completion of code generation for: autosar_tpc_throttle_sensor2 Build Summary Top model targets built: Model Action Rebuild Reason ================================================================================================= autosar_tpc_throttle_sensor2 Code generated. Code generation information file does not exist. 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 10.494s Exporting composition: autosar_tpc_composition ### Generating XML description files for: autosar_tpc_composition ### Successful completion of export for: autosar_tpc_composition
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'
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'
Version History
Introduced in R2020a
Open Example
You have a modified version of this example. Do you want to open this example with your edits?
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)