Main Content

coder.asap2.UserCustomizeBase

Customize project and module settings

Since R2022b

Description

Create a custom user object to define project and module information in the ASAP2 file.

Creation

Obj = coder.asap2.UserCustomizeBase creates an object to define PROJECT, MODULE, MOD, MOD_PAR, and MOD_COMMON settings. Use the object to add the fields to ASAP2 file.

Properties

expand all

Specify header information on a project as a character vector.

Specify the description relating to the ECU-specific management data as a character vector.

Specify the general description data for the module, which are used as standard in this module as a character vector.

Specify the ASAP2 file name as a character vector.

Specify the byte order of the relevant quantity.

Specify a name for the project as a character vector.

Specify a comment for the project as a character vector.

Specify a name for the module as a character vector.

Specify a comment for the module as a character vector.

Specify the header contents after the header name as a character vector.

Specify the header contents before ending the header as a character vector.

Specify the project contents after the project name as a character vector.

Specify the project contents before ending the project as a character vector.

Specify the module contents after the module name as a character vector.

Specify the module contents before ending the module as a character vector.

Specify the mod par contents at the beginning of mod par as a character vector.

Specify the mod par contents before ending of mod par as a character vector.

Specify the mod common contents at the beginning of mod common as a character vector.

Specify the mod common contents before ending of mod common as a character vector.

Specify the description for interface specific data as a character vector.

specify the interface specific data as a character vector.

Object Functions

writeFileHeadGet or set text at the beginning of ASAP2 file
writeFileTailGet or set text at the end of ASAP2 file
writeHardwareInterfaceGet or set custom data to describe ECU interface data
writeHeaderGet or set text from ASAP2 file header section

Examples

collapse all

This example shows how to add custom project and module information to an ASAP2 file.

Open and build the example model

Open the example model "ASAP2Demo"

open_system("ASAP2Demo");
slbuild("ASAP2Demo");
### Searching for referenced models in model 'ASAP2Demo'.
### Total of 2 models to build.
### Starting serial code generation build.
### Successfully updated the model reference code generation target for: ASAP2DemoModelRef
### Starting build procedure for: ASAP2Demo
### Successful completion of build procedure for: ASAP2Demo

Build Summary

Model reference code generation targets:

Model              Build Reason                                 Status                        Build Duration
============================================================================================================
ASAP2DemoModelRef  Target (ASAP2DemoModelRef.c) did not exist.  Code generated and compiled.  0h 0m 5.6898s 

Top model targets:

Model      Build Reason                                         Status                        Build Duration
============================================================================================================
ASAP2Demo  Information cache folder or artifacts were missing.  Code generated and compiled.  0h 0m 12.351s 

2 of 2 models built (0 models already up to date)
Build duration: 0h 0m 18.867s

Create custom base object

Create a custom base object, define the project and module information.

Obj = coder.asap2.UserCustomizeBase;
Obj.ProjectName = 'Demo project name';
Obj.ProjectComment = 'Custom comment for the demo project';
Obj.ModuleName = 'Demo module name';
Obj.ModuleComment = 'Custom comment for the demo module';
Obj.HeaderComment = 'Custom comment';

Generate the ASAP2 file by passing the object using the command

coder.asap2.export("ASAP2Demo",CustomizationObject=Obj);
Following Characteristics or Measurements with unsupported data types are not exported in ASAP2 file. "ASAP2Demo_DW.ASAP2DemoModelRef_InstanceData"

Version History

Introduced in R2022b