Main Content

このページの翻訳は最新ではありません。ここをクリックして、英語の最新版を参照してください。

C サービス インターフェイス

モデルの要素と関数を Embedded Coder ディクショナリで定義されたサービス インターフェイスにマッピング

C サービス コード インターフェイス構成を使用するコンポーネント モデルからコードを生成するときは、モデルのデータ要素をサービス インターフェイスにマッピングします。サービス インターフェイスにより、ターゲット プラットフォーム サービスの要件に応じて、生成コードの関数プロトタイプ情報とデータ通信方法 (Direct Access、Outside Execution、または During Execution) が指定されます。コード ジェネレーターでは、サービス インターフェイスのコードを生成するときに制約を適用します。これにより、特定のターゲット環境で使用するためのコードの統合が簡単になります。マッピングに使用できるサービス インターフェイスのリストは、モデルにリンクされた共有の Embedded Coder ディクショナリで定義されているインターフェイスで決まります。ディクショナリの既定のサービス インターフェイスがターゲット プラットフォーム サービスの要件に合致していれば、マッピングに変更を加える必要はなく、コンポーネント インターフェイスのコードの生成と確認に進むことができます。

ツール

コード マッピング エディター – サービス インターフェイスAssociate model elements with code interface definitions

オブジェクト

coder.mapping.api.CodeMappingC コード生成用のモデル データおよび関数インターフェイスの構成

関数

すべて展開する

model_initializeSimulink モデルの初期化コードが含まれる、生成された C/C++ エントリポイント関数
model_resetSimulink モデルのリセット コードが含まれる、生成された C/C++ エントリポイント関数
model_stepSimulink モデルの各ステップの実行コードが含まれる、生成された C/C++ エントリポイント関数
model_terminateSimulink モデルの終了コードが含まれる、生成された C/C++ エントリポイント関数

コード マッピングの作成および検索

coder.mapping.api.getモデルのコード マッピングの取得
coder.mapping.utils.createCreate code mappings object for configuring data and function interface for C and C++ code generation
findGet model elements for the category of model code mappings

関数の構成

getFunctionモデル関数に対するコード マッピングからのコード構成の取得
setFunctionモデル関数のコード マッピング情報の設定

ルートレベルの Inport および Outport の構成

getInportGet code and calibration configuration from code mappings for root-level inport
getOutportGet code and calibration configuration from code mappings for root-level outport
getDeploymentTypeGet deployment type of model
setInportConfigure root-level inports for code and calibration file (a2l) generation
setOutportConfigure root-level outport for code and calibration file (a2l) generation
setDeploymentTypeSet deployment type of model

パラメーターの構成

getModelParameterGet code and calibration configuration from code mappings for model parameters
setModelParameterConfigure model parameter for code and calibration file (a2l) generation

信号、状態、およびデータ ストアの構成

addSignalAdd block output signal to model code mappings
getDataStoreGet code and calibration configuration from code mappings for local or shared local data store
getSignalGet code and calibration configuration from code mappings for block output signal
getStateGet code and calibration configuration from code mappings for block state
removeSignalブロックの出力信号をモデル コード マッピングから削除する
setDataStoreコード生成とキャリブレーション ファイル (a2l) 生成用のローカル データ ストアまたは共有ローカル データ ストアを設定する
setSignalコード生成とキャリブレーション ファイル (a2l) 生成用のブロック信号データを設定する
setStateコードとキャリブレーション ファイル (a2l) の生成用のブロック状態の設定

データ転送の構成

getDataTransferGet code configuration from code mappings for signal representing data transfer
setDataTransferSet code configuration in code mappings for signal representing data transfer

トピック

構成の基礎

呼び出し可能な関数の構成

サービス インターフェイスの構成

データ アクセスと初期化