Main Content

このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。

coder.asap2.UserCustomizeBase

プロジェクトおよびモジュール設定をカスタマイズする

R2022b 以降

    説明

    Obj = coder.asap2.UserCustomizeBasePROJECTMODULEMODMOD_PAR、および MOD_COMMON の各設定を定義するオブジェクトを作成します。オブジェクトを使用してフィールドを ASAP2 ファイルに追加します。

    すべて折りたたむ

    この例では、カスタム プロジェクトおよびモジュール情報を ASAP2 ファイルに追加する方法について説明します。

    モデル例を開いて作成

    モデル例 "ASAP2Demo" を開きます。

    open_system("ASAP2Demo");
    rtwbuild("ASAP2Demo");
    ### 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 21.039s
    

    カスタム基底オブジェクトの作成

    カスタム基底オブジェクトを作成し、プロジェクトおよびモジュール情報を定義します。

    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';

    次のコマンドを使用してオブジェクトを渡し、ASAP2 ファイルを生成します。

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

    出力引数

    すべて折りたたむ

    この関数は UserCustomizeBase オブジェクトを作成します。これを使用して、ASAP2 ファイルで PROJECTMODULEMODMOD_PAR、および MOD_COMMON の各設定を追加できます。

    ヒント

    coder.asap2.UserCustomizeBase オブジェクトを使用して以下のフィールドを定義します。

    フィールド
    HeaderComment
    ModParComment
    ModCommonComment
    ASAP2FileName
    ByteOrder
    ProjectName
    ProjectComment
    ModuleName
    ModuleComment
    AfterBeginHeaderComments
    BeforeEndHeaderComments
    AfterBeginProjectComments
    BeforeEndProjectComments
    AfterBeginModuleComments
    BeforeEndModuleComments
    AfterBeginModParComments
    BeforeEndModParComments
    AfterBeginModCommonComments
    BeforeEndModCommonComments
    AddA2MLSection
    AddIfDataSection

    バージョン履歴

    R2022b で導入