メインコンテンツ

このページは前リリースの情報です。該当の英語のページはこのリリースで削除されています。

coder.asap2.UserCustomizeBase

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

R2022b 以降

    説明

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

    すべて折りたたむ

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

    モデル例を開いて作成

    モデル例 "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
    

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

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

    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 で導入