coder.asap2.merge
Description
merges the data elements from the source A2L file specified in the
mergeObj
= coder.asap2.merge(modelName
,a2lFilePath
)a2lFilePath
with the ECU descriptor object of Simulink model
modelName
. You can merge more than one A2L files with the Simulink
model.
Note
To use the coder.asap2.merge
function, Vehicle Network Toolbox™ is required.
Examples
Merge ASAP2 Files
Open a model and build it. The model can be dummy without any data elements.
open_system("ModelName1");
slbuild(bdroot);
Call the function by specifying the A2L files to be merged.
mergeObj = coder.asap2.merge("ModelName1",{"ASAP2File1.a2l","ASAP2File2.a2l"});
The mergeObj
descriptor object for the model
ModelName1
contains the data elements from the ASAP2 files
ASAP2File1
and ASAP2File2
.
Export the ASAP2 file for the model by using the command.
coder.asap2.export("ModelName1",CustomEcuDescriptions=mergeObj)
Input Arguments
modelName
— Simulink model name
char vector | string scalar
Specify the Simulink model name. Generate code for the model before calling it for merge.
Example: ModelName1
a2lFilePath
— Path and name of the A2L file
char vector | string scalar
Specify the path and name of the A2L file. If the A2L file is in the working directory,specify the file name.
Example: folder/asap2FileName1.a2l
Example: asap2FileName2.a2l
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'
updates the ECU description object of the model by
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
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 32-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
Full path to a folder in which to place an exported 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 flase
to exclude.
Example: IncludeReferencedModels=true
IncludeSharedElements
— Export compu methods and record layouts separately
true (default) | false
Generate separate A2L files for compu methods 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'
Output Arguments
mergeObj
— Merged object
Custom ECU Description
object
ECU description object containing the data elements from the specified Simulink
model and A2L file. Use the object with coder.asap2.export
function
to export the merged A2L file.
Version History
Introduced in R2023a
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 (한국어)