Real-Time Workshop Embedded Coder    

Generating an ASAP2 File

You can generate an ASAP2 file from your model in one of the following ways:

This section discusses how to generate an ASAP2 file via the targets that have built-in ASAP2 support.

Generating ASAP2 Files via the Real-Time Windows Embedded Coder

The procedure for generating a mode's data definition in ASAP2 format via the Real-Time Windows Embedded Coder is as follows:

  1. Create the desired model. Use appropriate parameter names and signal labels to refer to CHARACTERISTICS and MEASUREMENTS respectively.
  2. Define the relevant ASAP2.Parameter and ASAP2.Signal objects in the MATLAB workspace.
  3. Configure the data objects to generate unstructured global storage declarations in the generated code by assigning one of the following storage classes to the RTWInfo.StorageClass property:
  4. Configure the other data object properties such as LongID_ASAP2, PhysicalMin_ASAP2, etc.
  5. In the Advanced pane of the Simulation Parameters dialog box, select the Inline parameters option.
  1. Note that you should not configure the parameters associated with your data objects in the Model Parameter Configuration dialog box. If a parameter that resolves to a Simulink data object is configured using the Model Parameter Configuration dialog box, the dialog box configuration is ignored. You can, however, use the Model Parameter Configuration dialog to configure other parameters in your model.

  1. In the Real-Time Workshop pane, click Browse to open the System Target File Browser. In the browser, select the Real-Time Windows Embedded Coder Target.
  2. Select ERT code generation options (2) from the Category menu of the Real-Time Workshop pane. Then select the Generate ASAP2 file option.

  1. Click Apply.
  2. Click Build (or Generate code).
  3. Real-Time Workshop writes the ASAP2 file to the build directory. The ASAP2 filename is controlled by the ASAP2 setup file. By default, the file is named model.a2l.

Generating ASAP2 Files via the ASAM-ASAP2 Data Definition Target

The procedure for generating a model's data definition in ASAP2 format via the ASAM-ASAP2 Data Definition Target is as follows:

  1. Create the desired model. Use appropriate parameter names and signal labels to refer to CHARACTERISTICS and MEASUREMENTS respectively.
  2. Define the relevant ASAP2.Parameter and ASAP2.Signal objects in the MATLAB workspace.
  3. Configure the data objects to generate unstructured global storage declarations in the generated code by assigning one of the following storage classes to the RTWInfo.StorageClass property:
  4. Configure the other data object properties such as LongID_ASAP2, PhysicalMin_ASAP2, etc.
  5. In the Advanced pane of the Simulation Parameters dialog box, select the Inline parameters option.
  1. Note that you should not configure the parameters associated with your data objects in the Model Parameter Configuration dialog box. If a parameter that resolves to a Simulink data object is configured using the Model Parameter Configuration dialog box, the dialog box configuration is ignored. You can, however, use the Model Parameter Configuration dialog to configure other parameters in your model.

  1. In the Real-Time Workshop pane, click Browse to open the System Target File Browser. In the browser, select the ASAM-ASAP2 Data Definition Target.
  2. Select Target configuration from the Category menu of the Real-Time Workshop pane. Then select the Generate code only option.
  1. This picture shows the correct configuration.

  1. Click Apply.
  2. Click Generate code.
  3. Real-Time Workshop writes the ASAP2 file to the build directory. The ASAP2 filename is controlled by the ASAP2 setup file. By default, the file is named model.a2l.

  Defining ASAP2 Information Customizing an ASAP2 File