coder.asap2.export
Description
coder.asap2.export(
generates an
ASAP2 (A2L) file for modelName
)modelName
. The ASAP2 (A2L) file generated for a
top model contains information from the referenced models.
coder.asap2.export(
specifies additional options for ASAP2 (A2L) creation with one or more "Name=Value"
arguments. For example, you can specify a location where to save the A2L file. You can
provide the symbol file of the model to replace ECU addresses in the A2L file. modelName
,Name=Value
)
Examples
Generate ASAP2 File for Model
Generate an A2L file for the selected model and save it in the build folder of the model by using this command.
% Generate A2L file for model coder.asap2.export('modelName')
Generate A2L File by Using Customizations
Generate an A2L file by modifying the name of ASAP2 file, location where to save it, version of A2L to be generated, and excluding comments by using this command.
% Export A2L file and save it as coder.asap2.export('modelName',FileName='test_car') % Export A2L file to specified path coder.asap2.export('modelName',Folder='/home/temp/workspace/') % Generate A2L file with version 1.71 coder.asap2.export('modelName',Version='1.71') % Generate A2L file with comments excluded coder.asap2.export('modelName',Comments=false)
Generate ASAP2 File for Model by Using Symbol File
Generate an A2L file for the selected model that has ECU addresses based on the ELF symbol file associated with the executable by using this command.
% Generate A2L file for model coder.asap2.export('modelName',MapFile='model.elf')
Exclude A2ML and IF_DATA Sections from Generated A2L File
Generate an A2L file for the selected model and exclude the A2ML and IF_DATA sections by using this command.
% Generate A2L file with A2ML and IF_DATA excluded coder.asap2.export('modelName',GenerateXCPInfo=false)
Generate ASAP2 File by Using Custom Model Class Instance Name
Specify the name of the model class instance. The
objName
is declared in the global namespace by using this
command.
% Use custom specified name as object name in A2L file coder.asap2.export('modelName',ModelClassInstanceName='objName') % Specify the name of model class instance declared inside the namespace. Here instance customObj % is declared in customNameSpace coder.asap2.export('modelName',ModelClassInstanceName='customNamespace::customObj')
Generate ASAP2 File by Using Customized ASAP2 Fields
Create a custom base object and specify the fields. Customize the contents of the A2L file by using a custom base object by using this command.
% Create custom base object and provide fields you want to modify obj = coder.asap2.UserCustomizeBase; obj.HeaderComment = 'Header comment'; obj.ModParComment = 'Mod Par comment'; obj.ModCommonComment = 'Mod Common comment'; obj.ASAP2FileName = 'File name'; obj.ByteOrder = 'BYTE_ORDER MSB_LAST'; % Generate A2L file with custom base created coder.asap2.export('modelName',CustomizationObject=obj);
Generate ASAP2 File by Grouping Parameters and Measurements
Group the parameters and measurements into arrays, scalars, maps, and curves by using this command.
coder.asap2.export('modelName',CustomizeGroupsBy={'ARRAY','SCALAR','MAP','CURVE'});
Export Record Layouts
Export the record layouts of the base data types to a file named
RecordLayouts.a2l
by using this command.
coder.asap2.export('modelName',IncludeAllRecordLayouts=true)
Generate ASAP2 File by Excluding Structures
Exclude structure elements by using this command.
coder.asap2.export('modelName', SupportStructureElements=false);
Generate ASAP2 File by Excluding Referenced Model Elements
Exclude referenced model elements by using this command.
coder.asap2.export('modelName', IncludeReferencedModels=false);
Generate ASAP2 File by Excluding 64-Bit Elements
Exclude 64-bit integers by using this command.
coder.asap2.export('modelName', Support64bitIntegers=false);
Generate ASAP2 File by Specifying ECU Address Extension
Specify additional address information in the A2L file by using this command.
coder.asap2.export('modelName', EcuAddressExtension=4);
Generate ASAP2 File Using the Saved Preferences
Generate the ASAP2 file using the settings updated by using this command.
coder.asap2.export('modelName', UseSavedSettings=false);
Generate ASAP2 File by Excluding RTE Elements
Exclude AUTOSAR RTE elements in the A2L file for a AUTOSAR classic model by using this command.
coder.asap2.export('autosarclassic-modelName', IncludeAutosarRteElements=false);
Generate ASAP2 File by Updating Array Layout
Export ASAP2 file by modifying the array layout to view the array data in required format by using this command.
coder.asap2.export('modelName', ToggleArrayLayout=true);
Generate Separate ASAP2 Files for Record Layouts and CompuMethods
Export record layouts and CompuMethods as separate A2L files for an embedded coder model by using this command.
coder.asap2.export('ert-modelName', IncludeSharedElements=true);
Input Arguments
modelName
— name of the model
character vector | string scalar
Name of the model.
Example: 'MyModel','nav_app'
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:
MapFile='model.elf'
generates an A2L file for the model containing debug
mapping information from the model.elf
file.
Comments
— Include comments in A2L file
true (default) | false
Generate the A2L file by including or excluding comments.
Example: Comments=true
CustomEcuDescriptions
— Update the ECU descriptions
ECU description object
Update the current ECU description in the ASAP2 file to custom values by creating and providing a description object.
Note
This argument cannot be used with other Name=Value pairs.
Example: CustomEcuDescriptions=description_object
CustomizationObject
— Customize ASAP2 fields
coder.asap2.UserCustomizeBase
object (default)
Create a user base and customize the ASAP2 fields such as:
ASAP2FileName
ByteOrder
HeaderComment
ModParComment
ModCommonComment
Example: CustomizationObject=obj
CustomizeGroupsBy
— Customize groups in ASAP2 file
ARRAY
| ASCII
| SCALAR
| MAP
| CUBOID
| CURVE
| CUBE_4
| CUBE_5
Group the parameters and signals based on their properties.
Example: CustomizeGroupsBy={'ARRAY','MAP'}
EcuAddressExtension
— Specify additional address information
int
Specify a 16-bit integer value to specify additional address information in the ASAP2 file. By default, no additional address information is required.
Example: EcuAddressExtension=4
FileName
— Custom name for the exported A2L file
character vector | string scalar
Name for the exported A2L file.
Example: FileName='test_car'
Folder
— Folder location to export A2L file
character vector | string scalar
Specify export location for the generated A2L file.
Example: Folder='/home/temp/prjct/'
GenerateXCPInfo
— Include A2ML and IF_DATA in A2L file
true (default) | false
Generate the A2L file by including or excluding A2ML and IF_DATA sections.
Example: GenerateXCPInfo=true
IncludeAllRecordLayouts
— Export record layouts of the base data types
false (default) | true
Export record layouts of all the base data types to a file named
RecordLayouts.a2l
according to the version of the A2L
file.
Example: IncludeAllRecordLayouts=true
IncludeAutosarRteElements
— Export RTE elements
true (default) | false
Generate the A2L file by including or excluding the AUTOSAR RTE elements.
Note
This option is applicable only for AUTOSAR classic models.
Example: IncludeAutosarRteElements=true
IncludeDefaultEventList
— Create default event
true (default) | false
Specify true to include a default event list in the A2L file.
Example: IncludeDefaultEventList=true
IncludeReferencedModels
— Export referenced model elements
true (default) | false
Specify true
to include referenced model elements in ASAP2
file. Specify false
to exclude.
Example: IncludeReferencedModels=true
IncludeSharedElements
— Export CompuMethods and record layouts separately
true (default) | false
Generate separate A2L files for CompuMethods and record layouts.
Note
This option is applicable for models with ERT - based system target files.
Example: IncludeSharedElements=true
IndentFile
— Follow indentation in A2L file
false (default) | true
Generate an A2L file by following indentation.
Example: IndentFile=true
MapFile
— Name of symbol file for model
ELF | PDB | DWARF
Name of the model symbol file that contains symbols of generated code. For example, the addresses of variables used in generated code.
Example: MapFile='model.elf'
ModelClassInstanceName
— Specify class instance and path names
character vector | string scalar
Custom model instance name in an A2L file. This argument is applicable only for AUTOSAR adaptive models.
Example: ModelClassInstanceName='customObj'
or
ModelClassInstanceName='customNameSpace::customObj'
Support64bitIntegers
— Include or exclude the 64-bit integers in ASAP2 file
true (default) | false
Specify false
to exclude 64-bit integers in the generated ASAP2
file.
Example: Support64bitIntegers=false
SupportStructureElements
— Include or exclude the structure elements in ASAP2 file
true (default) | false
Specify false
to exclude elements that are part of the
structure in the generated ASAP2 file.
Example: SupportStructureElements=false
ToggleArrayLayout
— Modify the array layout
false (default) | true
Update the array layout to ROW_DIR
or
COL_DIR
to view the array data in row wise or column wise.
Example: ToggleArrayLayout=true
UseSavedSettings
— Save and use the preferences
false (default) | true
Save the preferences made and generate the ASAP2 file with the preferences updated such as including the comments, version of the ASAP2 file.
Example: UseSavedSettings=false
Version
— Version of A2L file
1.71 (default) | 1.31 | 1.61
A2L file format based on the ASAM MCD-2 MC standard defined by ASAM. There are multiple versions of the ASAM MCD-2 MC standard. Specify the version of A2L that you want.
Example: Version='1.61'
or
Version='1.31'
Version History
Introduced in R2021aR2024a: Group Parameters and Signals of Type ASCII
The function now enables you to export the parameters and signals of ASCII data type as a group.
R2023a: Applicable for DDS Blockset Models
The function is now applicable for DDS Blockset models.
R2022b: Applicable for SLRT Models
The function is now applicable for Simulink Real-Time models. Additional name=value pairs are added to save the preferences of ASAP2 file generation, include the default event list, and toggle array layout.
For AUTOSAR classic models, use the function to include/exclude RTE elements.
R2022a: Additional Name=Value pairs
Additional name=value pairs are added to include/exclude structure elements, 64-bit integers, and add custom ECU descriptions to the ASAP2 file.
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 (한국어)