Main Content

export

Export AUTOSAR architecture model ARXML, ASAP2 file, and generate component code

Since R2020a

Description

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 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.

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.

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

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 28.938s 

1 of 1 models built (0 models already up to date)
Build duration: 0h 0m 31.119s
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 16.504s 

1 of 1 models built (0 models already up to date)
Build duration: 0h 0m 17.35s
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 18.474s 

1 of 1 models built (0 models already up to date)
Build duration: 0h 0m 19.25s
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 14.548s 

1 of 1 models built (0 models already up to date)
Build duration: 0h 0m 15.248s
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 18.938s 

1 of 1 models built (0 models already up to date)
Build duration: 0h 0m 20.012s
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 15.343s 

1 of 1 models built (0 models already up to date)
Build duration: 0h 0m 15.928s
Exporting dictionary: tpc_interfaces.sldd (1 out of 1)
Exporting dictionary, please wait...
Exported dictionary ARXML files are located in: /tmp/Bdoc24b_2679053_790536/tp85c58240/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

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 19.278s 

1 of 1 models built (0 models already up to date)
Build duration: 0h 0m 20.156s
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 15.104s 

1 of 1 models built (0 models already up to date)
Build duration: 0h 0m 15.699s
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 14.705s 

1 of 1 models built (0 models already up to date)
Build duration: 0h 0m 15.295s
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 14.556s 

1 of 1 models built (0 models already up to date)
Build duration: 0h 0m 15.201s
Exporting dictionary: tpc_interfaces.sldd (1 out of 1)
Exporting dictionary, please wait...
Exported dictionary ARXML files are located in: /tmp/Bdoc24b_2679053_790536/tp85c58240/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

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 16.011s 

1 of 1 models built (0 models already up to date)
Build duration: 0h 0m 16.708s
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 16.331s 

1 of 1 models built (0 models already up to date)
Build duration: 0h 0m 17.118s
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 15.423s 

1 of 1 models built (0 models already up to date)
Build duration: 0h 0m 15.973s
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 15.234s 

1 of 1 models built (0 models already up to date)
Build duration: 0h 0m 15.858s
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 14.525s 

1 of 1 models built (0 models already up to date)
Build duration: 0h 0m 15.148s
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 14.642s 

1 of 1 models built (0 models already up to date)
Build duration: 0h 0m 15.208s
Exporting dictionary: tpc_interfaces.sldd (1 out of 1)
Exporting dictionary, please wait...
Exported dictionary ARXML files are located in: /tmp/Bdoc24b_2679053_790536/tp85c58240/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

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 18.07s  

1 of 1 models built (0 models already up to date)
Build duration: 0h 0m 18.795s
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 14.862s 

1 of 1 models built (0 models already up to date)
Build duration: 0h 0m 15.678s
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 16.058s 

1 of 1 models built (0 models already up to date)
Build duration: 0h 0m 16.848s
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 14.097s 

1 of 1 models built (0 models already up to date)
Build duration: 0h 0m 14.734s
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 16.544s 

1 of 1 models built (0 models already up to date)
Build duration: 0h 0m 17.257s
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 16.337s 

1 of 1 models built (0 models already up to date)
Build duration: 0h 0m 17.27s
Exporting dictionary: tpc_interfaces.sldd (1 out of 1)
Exporting dictionary, please wait...
Exported dictionary ARXML files are located in: /tmp/Bdoc24b_2679053_790536/tp85c58240/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

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

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.

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

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

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

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

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.

Note

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

Example: 'ExportASAP2File',true

Version History

Introduced in R2020a

expand all