FunctionPortSpecification
説明
C Caller ブロックの関数定義と戻り引数をクエリして構成します。C Caller ブロックの入力引数をプログラムで構成します。
作成
myCCallerObj = get_param(gcb, 'FunctionPortSpecification')
は、選択された C Caller ブロックについての C Caller ブロックの構成オブジェクトを作成します。
プロパティ
CPrototype
— C Caller ブロックへの C 関数のマッピング
文字ベクトル
モデルでの C 関数の入力の C Caller ブロックへのマッピングを表示します。このプロパティはコマンド ラインを使用して編集することはできません。C 関数のマッピングを編集するには、C Caller ブロックのソース コードを編集します。
例: real_T add(real_T u1, real_T u2);
データ型: char
InputArguments
— 関数の入力引数のリスト
FunctionArgument
オブジェクト
FunctionArgument
オブジェクトとして関数の入力引数のリストを返します。
データ型: FunctionArgument
ReturnArgument
— 関数の出力引数
FunctionArgument
スカラー
出力引数を FunctionArgument
オブジェクトとして返します。
データ型: FunctionArgument
GlobalArguments
— グローバル引数のリスト
FunctionArgument
スカラー
FunctionArgument
オブジェクトとして関数インターフェイスのグローバル引数のリストを返します。
データ型: FunctionArgument
オブジェクト関数
getGlobalArg | C Caller ブロックのグローバル変数のオブジェクト定義を取得する |
例
C Caller ブロックの構成オブジェクトの作成
C Caller ブロックを使用した C 関数の呼び出しの例からモデルを開きます。
openExample('simulink_features/CallCFunctionsUsingCCallerBlockExample') open_system('slexCCallerExample.slx')
slexCCallerExample
という名前のモデルを使用して C Caller ブロックの構成オブジェクトを作成します。
my_CCallerObj = get_param('slexCCallerExample/C Caller',... 'FunctionPortSpecification')
my_CCallerObj = FunctionPortSpecification with properties: CPrototype: 'real_T add(real_T u1, real_T u2);' InputArguments: [1×2 Simulink.CustomCode.FunctionArgument] ReturnArgument: [1×1 Simulink.CustomCode.FunctionArgument] GlobalArguments: [1×0 Simulink.CustomCode.FunctionArgument]
1 つ目の入力端子の FunctionArgument
オブジェクトを作成します。
inargone = my_CCallerObj.InputArguments(1)
inargone = FunctionArgument with properties: Name: 'u1' PortNumber: 1 Size: '1' Type: 'double' Label: 'u1' Scope: 'Input'
1 つ目の入力端子のラベルを変更します。
inargone.Label = 'inputport1'
FunctionArgument with properties: Name: 'u1' PortNumber: 1 Size: '1' Type: 'double' Label: 'inputport1' Scope: 'Input'
バージョン履歴
R2019b で導入
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)