Main Content

Introduction to ASAP2 File

The ASAM MCD-2 MC standard, also known as ASAP2, is a data definition standard proposed by the Association for Standardization of Automation and Measuring Systems (ASAM). ASAP2 is a non-object-oriented description of the data used for measurement, calibration, and diagnostic systems. For more information on ASAM and the ASAM MCD-2 MC (ASAP2) standard, see the ASAM website at www.asam.net.

To make use of ASAP2 file generation and customization, you should become familiar with:

Define System Target File to Generate ASAP2 File

You can generate an ASAP2 file with varying system target file configurations. For example, ERT-based, GRT-based, Simulink Real-Time, AUTOSAR Classic, or AUTOSAR Adaptive system target configurations allow you to generate an ASAP2 file by using the Generate Calibration Files tool or the coder.asap2.export function.

Define ASAP2 Information for Signals and Parameters

Information about parameters and signals in your model is required to generate an ASAP2 file. Use the Model Data Editor and built-in Simulink® data objects to provide information, such as using Simulink.Signal objects to provide measurement information and Simulink.Parameter objects to provide characteristic information. You can also use data objects from data classes that are derived from Simulink.Signal and Simulink.Parameter to provide this information.

For more information, see Data Objects and Model Data Editor.

A Simulink.Signal is generated as Measurement in the ASAP2 file.

Measurement data fields from an ASAP2 fiie

A Simulink.Parameter is generated as Characteristic in the ASAP2 file.

Characteristic data fields from an ASAP2 file

Define ASAP2 Information for Lookup Tables

Simulink Coder™ software generates ASAP2 descriptions for lookup table data and its breakpoints. The software represents 1-D table data as CURVE information, 2-D table data as MAP information, and breakpoints as AXIS_DESCR and AXIS_PTS information. You can model lookup tables by using one of these Simulink Lookup Table blocks:

The software supports these types of lookup table breakpoints (axis points).

Breakpoint TypeInformation Generated
Tunable and shared among multiple table axes (common axis)

COM_AXIS

Fixed and nontunable (fixed axis)

One of these variants of FIX_AXIS:

  • FIX_AXIS_PAR if breakpoints are integers with equidistant spacing and the equidistant spacing is a power of 2

  • FIX_AXIS_PAR_DIST if breakpoints are integers with equidistant spacing

  • FIX_AXIS_PAR_LIST if breakpoints are integers with non-equidistant spacing

Tunable but not shared among multiple tables (standard axis)

STD_AXIS

When you configure the blocks for ASAP2 code generation:

  • To configure a standard axis, use a n-D Lookup Table block. Use a Simulink.LookupTable object for table data and specify the Breakpoint Specification block parameter as Explicit values.

  • To configure a common axis, use an Interpolation Using Prelookup block and use a Simulink.LookupTable object in the table data.

    • For the Simulink.LookupTable object, specify Breakpoint Specification as Reference.

    • For breakpoints, use Prelookup blocks and table data using Simulink.Breakpoint objects.

  • To configure a fixed axis, use an n-D Lookup Table block. Use a Simulink.Lookuptable object for table data and specify the Breakpoint Specification block parameter as Even Spacing.

    • For ASAP2 version 1.31 and earlier, the breakpoints must be stored as integers in the code. The data type must be a built-in integer type (int8, int16, int32, uint8, uint16, or uint32), a fixed-point data type, or an equivalent alias type.

    • For ASAP2 version 1.6 and later, the breakpoints can be stored as floating-point types in the code.

Here is an example of an n-D Lookup Table record generated into an ASAP2 file in Standard Axis format.

A lookup table object data fields from an ASAP2 file

Structure of ASAP2 File

This table outlines the basic structure of the ASAP2 file and describes the customization functions used to create each part of the file.

File Section

Function to update the section

File header

HeaderComment

/begin PROJECT ""

AfterBeginProjectContents

/begin HEADER ""
HEADER contents

AfterBeginHeaderContents

/end HEADER

/end HEADER

/begin MODULE ""
MODULE contents:

AfterBeginModuleContents

- A2ML
- MOD_PAR
- MOD_COMMON
...

Model-dependent MODULE contents:

 

AXIS_PTS

coder.asap2.AxisInfo

CHARACTERISTIC

coder.asap2.Characteristic

COMPU_METHOD

coder.asap2.CompuMethod

FUNCTION

coder.asap2.Function

GROUP

coder.asap2.Group

MEASUREMENT

coder.asap2.Measurement

RECORD_LAYOUT

coder.asap2.RecordLayout

VARIANT_CODING

/end MODULE

/end MODULE

File footer/tail

writeFileTail

For an example about how to generate an ASAP2 file from a Simulink model, see Generate ASAP2 and CDF Data Definition Files.

For more answers to questions about ASAP2 file generation, see Frequently Asked Questions About ASAP2 File Generation.

See Also

| |

Topics