Generate ASAP2 and CDF Calibration Files
Generate and customize an ASAP2 file and a CDF (Calibration Data Format) file for a model
by using the Generate Calibration
Files tool. By default, the tool generates the latest supported version of the A2L
file according to ASAM MCD-2 MC standards. You can choose to generate a different version. You
can customize the options for calibration files, such as the version for the A2L file and the
schema type, for the CDF file. For more information on the ASAM MCD-2 MC (ASAP2) standard and
the ASAM CDF Standards, see the ASAM website at
Open Generate Calibration Files Tool
Open the model.
Open the Embedded Coder app.
For AUTOSAR models, open the AUTOSAR Component Designer app. And for Simulink Real-Time models, open the Simulink Coder app.
Generate code for the model.
On the C Code tab, select Share > Generate Calibration Files.
For AUTOSAR models, select Autosar > Share > Generate Calibration Files.
Using the tool, you can generate A2L and
cdfx files at the same time
for a model. You can use the tool for models configured with an ERT-based, GRT-based,
Simulink Real-Time, Classic AUTOSAR, or Adaptive AUTOSAR system target file. The tool
remembers the last used settings, such as the version of the ASAP2 file, include or exclude
comments, turn off or on the ASAP2 file and CDF file generation. Simulink saves these
settings in the MATLAB preferences. The settings will override the default settings.
For Adaptive AUTOSAR and Simulink Real-Time system target files, you can generate the ASAP2 file for the C++ language. For GRT- and ERT- based system target files, you can generate an ASAP2 file only for C.
For classic AUTOSAR models, the tool allows you to include or exclude RTE elements into
the ASAP2 file by using the
Include AUTOSAR RTE elements option.
ASAP2 File Generation
ASAP2 defines the description format of the internal ECU variables used for tuning parameters and measuring signal data as an application executes. To generate an ASAP2 file:
By default the Generate ASAP2 option is enabled. If it is not enabled, slide the Generate ASAP2 slider to the on position to enable A2L generation.
To change the name of the A2L file, in the File name field, specify the name.
By default, the code generator uses the build folder for the folder path of the selected model. If you want to specify a different folder path for the A2L file, you can do that in the Folder path field.
To replace ECU addresses in the A2L file, in the Symbol file field, provide a symbol file associated with the application executable. Otherwise, clear the Address replacement field.
The tool supports an ELF, PDB, DWARF, or executable file as a symbol file to replace the ECU addresses.
Set Version to the required version of the A2L file to be generated. The default version is 1.71.
To exclude comments in the A2L file, clear Include comments.
For Classic AUTOSAR models, to exclude RTE elements in the A2L file, clear Include AUTOSAR RTE elements.
To generate the A2L file programmatically, use the
CDF File Generation
ASAM CDF defines the data description format for storing the ECU parameter values and the associated meta data. The ASAM CDF files use XML, which can be easily validated, edited, imported, and exported by calibration tools and XML editors. To generate a CDF file by using the tool:
Slide the Generate CDF slider to the on position.
To change the name of the CDF file, specify it in the File name field.
By default, the code generator selects the build folder for the folder path of the selected model. If you want to specify a different folder path for the CDF file, in the Folder path field, specify the path.
Use the Schema type field to set to XSD (XML Schema Definition) or DTD (Document Type Definition). The DTD schema type is the default.
To generate the CDF file programmatically, use
CDF file generation is disabled for Simulink Real-Time system target file.
Create a Host-Based ASAM-ASAP2 Data Definition File for Data Measurement and Calibration
This model shows ASAP2 data export. ASAP2 is a data definition standard proposed by the Association for Standardization of Automation and Measuring Systems (ASAM).
Open Example Model
Open the example model ASAP2Demo.
See the ASAP2 File Generation to customize and generate the ASAP2 file.
coder.asap2.export | Generate Calibration Files