Main Content

Frequently Asked Questions About ASAP2 File Generation

ASAP2 standard defines the description format of the internal electronic control unit (ECU) variables used in measurement and calibration and ASAM CDF standard defines the data for storing the ECU parameter values and the associated meta data. For more information about ASAP2 file generation, see .

Find the frequently asked questions about generating an ASAP2 file, good to know information, and limitations here.

How to export data elements with custom storage classes to ASAP2 files?

To export data elements with custom storage classes, create a custom attributes class for the custom storage class and associate it with a boolean property, SupportSILPIL, set to true. For example:

classdef myCustomAttribs< Simulink.CustomStorageClassAttributes
properties(PropertyType = 'logical scalar')
    SupportSILPIL = true;
  end
end

Add the custom storage class to the csc_registration file:

set(h, 'CSCTypeAttributesClassName', 'myPackage.myCustomAttribs');

For more information about SIL and PIL simulations, see SIL and PIL Simulations (Embedded Coder).

For more information about custom storage class definitions, see Create Storage Classes by Using the Custom Storage Class Designer (Embedded Coder).

How do you exclude all inports and outports from ASAP2 file for an Embedded Coder model?

Use the Export property of an inport or outport to include or exclude them in an ASAP2 file. To exclude all inports and outports, use the find function to locate all inports and outports and then set the Export property of each them to false. For example:

cm = coder.mapping.utils.create(<modelName>);
inports = find(cm,'Inports');
outports = find(cm,'Outports');
for i = 1:numel(inports)
    setInport(cm,inports(i),'Export',false);
end
for i = 1:numel(outports)
    setOutport(cm,outports(i),'Export',false);
end

For more information, see coder.mapping.api.CodeMapping (Embedded Coder).

How do you data stores and states to an ASAP2 file?

Data stores and states are not exported to an ASAP2 file even after setting the calibration properties through code mappings. To export data stores and states, provide a name for each data store and state. For example:

Block Parameters dialog box. The State name parameter is set to DelayState.

How do you change the newline format in an ASAP2 file?

To change the newline format in an ASAP2 file, in the Configuration Parameters dialog box, in the Code Generation > Code Style pane, in the Advanced parameters section set Newline style to CR_LF (Carriage Return + Line Feed).Configuration Parameters dialog box. The Newline style parameter is set to CR+LF (Carriage Return + Line Feed).

How do you export elements that are owned by a module to an ASAP2 file?

To export elements that are owned by a module to ASAP2 file, in the model configuration parameters , in theCode Generation > Code Placement pane, in the Global data placement (custom storage classes only) section:

  • From the Data definition list, select Data defined in a single separate source file.

  • Specify a name for Data definition filename.

  • Select Use owner from data object for data definition placement.

In the code generation parameters of the elements, specify the C file name added for Data definition filename from configuration parameters in the DefinitionFile field and Owner field.

How do you avoid grouping elements in an ASAP2 file?

To export an ASAP2 file without having any groups, use these commands.

descObj = coder.asap2.getEcuDescriptions(<modelName>);
groups = find(descObj,"Group");
for group = groups
    delete(descObj,'Group',group)
end
coder.asap2.export(<modelName>,'CustomEcuDescriptions',descObj);

Limitations

  • The Pointer variables are not generated in an ASAP2 file.

  • coder.asap2.merge is not supported on the macOS operating system.

  • Merging of lookup table objects is not supported with coder.asap2.merge. The function skips the lookup table objects from the ASAP2 file that is being merged to the Simulink® model.

  • Lookup table blocks configured with Simulink bus elements or structure elements are exported as individual elements for table values and breakpoints to the ASAP2 file. To avoid this, use Simulink.LookupTable objects.

  • Address replacement is not supported on the macOS operating system.

See Also

| |

Related Topics