Main Content

getDataInterfaces

クラス: coder.codedescriptor.CodeDescriptor
名前空間: coder.codedescriptor

指定されたデータ インターフェイスの情報を返す

構文

dataInterface = getDataInterfaces(codeDescObj, dataInterfaceName)

説明

dataInterface = getDataInterfaces(codeDescObj, dataInterfaceName) は、dataInterfaceName が指定するデータ インターフェイスのデータの種類、SID、グラフィカル名、タイミング、実装およびバリアント情報を返します。

入力引数

すべて展開する

生成されたコードに関する情報を取得する coder.codedescriptor.CodeDescriptor オブジェクト。

dataInterfaceName は、データ インターフェイスの名前を指定します。生成されたコードのすべてのデータ インターフェイスのリストを取得するには、getDataInterfaceTypes() を呼び出します。

データ型: string

出力引数

すべて展開する

coder.descriptor.DataInterface オブジェクトは、データの種類、SID、グラフィカル名、タイミング、実装およびバリアント情報などの指定されたデータ インターフェイスに関する情報を示します。

  1. CustomCodeComments モデルを開きます。

    openExample('CustomCodeComments')
  2. モデルをビルドします。

    slbuild('CustomCodeComments')

  3. 必要なモデルの coder.codedescriptor.CodeDescriptor オブジェクトを作成します。

    codeDescObj = coder.getCodeDescriptor('CustomCodeComments')
    

  4. 生成されたコードのすべてのデータ インターフェイスの種類のリストを返します。

    dataInterfaceTypes = getDataInterfaceTypes(codeDescObj)
    dataInterfaceTypes の値は次のとおりです。
        {'Inports'         }
        {'Outports'        }
        {'Parameters'      }
        {'ExternalParameterObjects'}
        {'InternalData'    }

  5. 生成されたコードの Inport ブロックのプロパティを返します。

    dataInterface = getDataInterfaces(codeDescObj, 'Inports')
    dataInterfacecoder.descriptor.DataInterface オブジェクトの配列です。配列の最初の位置にアクセスして、モデルの最初の Inport ブロックの詳細を取得します。
    dataInterface(1)
    プロパティをもつ最初の coder.descriptor.DataInterface オブジェクトが返されます。
                  Type: [1×1 coder.descriptor.types.Type]
                   SID: 'CustomCodeComments:99'
         GraphicalName: 'In1'
           VariantInfo: [1×0 coder.descriptor.VariantInfo]
        Implementation: [1×1 coder.descriptor.DataImplementation]
                Timing: [1×1 coder.descriptor.TimingInterface]
                  Unit: ''
                 Range: [1×0 coder.descriptor.Range]

バージョン履歴

R2018a で導入