Main Content

coder.asap2.UserCustomizeBase

Customize project and module settings

Since R2022b

    Description

    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.

    example

    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'.
    ### Found 1 model reference targets 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
    
    Model reference code generation targets:
    
    Model              Build Reason                                 Status                        Build Duration
    ============================================================================================================
    ASAP2DemoModelRef  Target (ASAP2DemoModelRef.c) did not exist.  Code generated and compiled.  0h 0m 7.5428s 
    
    Top model targets:
    
    Model      Build Reason                                         Status                        Build Duration
    ============================================================================================================
    ASAP2Demo  Information cache folder or artifacts were missing.  Code generated and compiled.  0h 0m 15.755s 
    
    2 of 2 models built (0 models already up to date)
    Build duration: 0h 0m 24.844s
    

    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