Main Content

coder.asap2.UserCustomizeBase

Customize project and module settings

Since R2022b

    Description

    example

    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.

    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");
    rtwbuild("ASAP2Demo");
    ### Searching for referenced models in model 'ASAP2Demo'.
    ### Found 1 model references to update.
    ### Starting serial model reference 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
    
    Code generation targets built:
    
    Model              Action                        Rebuild Reason                       
    ======================================================================================
    ASAP2DemoModelRef  Code generated and compiled.  ASAP2DemoModelRef.c does not exist.  
    
    Top model targets built:
    
    Model      Action                        Rebuild Reason                                    
    ===========================================================================================
    ASAP2Demo  Code generated and compiled.  Code generation information file does not exist.  
    
    2 of 2 models built (0 models already up to date)
    Build duration: 0h 0m 24.502s
    

    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"
    

    Output Arguments

    collapse all

    The function creates an UserCustomizeBase object and it can be used to add the PROJECT, MODULE, MOD, MOD_PAR, and MOD_COMMON settings in the ASAP2 file.

    Tips

    Use the coder.asap2.UserCustomizeBase object to define the following fields:

    Field
    HeaderComment
    ModParComment
    ModCommonComment
    ASAP2FileName
    ByteOrder
    ProjectName
    ProjectComment
    ModuleName
    ModuleComment
    AfterBeginHeaderComments
    BeforeEndHeaderComments
    AfterBeginProjectComments
    BeforeEndProjectComments
    AfterBeginModuleComments
    BeforeEndModuleComments
    AfterBeginModParComments
    BeforeEndModParComments
    AfterBeginModCommonComments
    BeforeEndModCommonComments
    AddA2MLSection
    AddIFDataSection

    Version History

    Introduced in R2022b