このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。
getFunction
Simulink エントリポイント関数の AUTOSAR マッピング情報の取得
構文
説明
は、Simulink® エントリポイント関数 arRunnableName
= getFunction(slMap
,slEntryPointFunction
)slEntryPointFunction
にマッピングされた AUTOSAR ランナブル arRunnableName
の名前を返します。
[
は、マッピングされた AUTOSAR ランナブルに定義された関数および内部データ ソフトウェアのアドレス メソッド (arRunnableName
,arRunnableSwAddrMethod
,arInternalDataSwAddrMethod
] = getFunction(slMap
,slEntryPointFunction
)SwAddrMethod
) の名前を返します。SwAddrMethod
が定義されていない場合、'<None>'
が返されます。
例
Simulink エントリポイント関数の AUTOSAR ランナブル名の取得
モデル例 autosar_swc
で Simulink エントリポイント関数にマッピングされた AUTOSAR ランナブルの名前を取得します。このモデルには、Runnable_Init
という名前の初期化エントリポイント関数と、Runnable_1s
および Runnable_2s
という名前の周期エントリポイント関数があります。
hModel = 'autosar_swc'; openExample(hModel); slMap=autosar.api.getSimulinkMapping(hModel); arRunnableName=getFunction(slMap,'Initialize')
arRunnableName = 'Runnable_Init'
Simulink エントリポイント関数の AUTOSAR SwAddrMethod
名の取得
モデル例 autosar_swc_counter
の Simulink エントリポイント関数の AUTOSAR SwAddrMethod
名を取得します。このモデルには、シングルタスク周期エントリポイント関数があります。
hModel = 'autosar_swc_counter'; openExample(hModel); % Add SwAddrMethods myCODE and myVAR to the AUTOSAR component arProps = autosar.api.getAUTOSARProperties(hModel); addPackageableElement(arProps,'SwAddrMethod',... '/Company/Powertrain/DataTypes/SwAddrMethods','myCODE',... 'SectionType','Code') swAddrPaths = find(arProps,[],'SwAddrMethod','PathType','FullyQualified',... 'SectionType','Code') addPackageableElement(arProps,'SwAddrMethod',... '/Company/Powertrain/DataTypes/SwAddrMethods','myVAR',... 'SectionType','Var') swAddrPaths = find(arProps,[],'SwAddrMethod','PathType','FullyQualified',... 'SectionType','Var') % Set code generation parameter for runnable internal data SwAddrMethods set_param(hModel,'GroupInternalDataByFunction','on') % Map periodic function and internal data to myCODE and myVAR SwAddrMethods slMap = autosar.api.getSimulinkMapping(hModel); mapFunction(slMap,'Periodic','Runnable_Step',... 'SwAddrMethod','myCODE','SwAddrMethodForInternalData','myVAR') % Return AUTOSAR mapping information for periodic function [arRunnableName,arRunnableSwAddrMethod,arInternalDataSwAddrMethod] = ... getFunction(slMap,'Periodic')
swAddrPaths = 1×2 cell array {'/Company/Powertrain/DataTypes/SwAddrMethods/CODE'} {'/Company/Powertrain/DataTypes/SwAddrMethods/myCODE'} swAddrPaths = 1×2 cell array {'/Company/Powertrain/DataTypes/SwAddrMethods/VAR'} {'/Company/Powertrain/DataTypes/SwAddrMethods/myVAR'} arRunnableName = 'Runnable_Step' arRunnableSwAddrMethod = 'myCODE' arInternalDataSwAddrMethod = 'myVAR'
入力引数
slMap
— モデルの Simulink から AUTOSAR へのマッピング情報
ハンドル
以前に
によって返されたモデルの Simulink から AUTOSAR へのマッピング情報。slMap
= autosar.api.getSimulinkMapping(model
)
は、モデル名を表すハンドル、文字ベクトル、または string スカラーです。model
例: slMap
slEntryPointFunction
— Simulink のエントリポイント関数
文字ベクトル | string スカラー
AUTOSAR マッピング情報を返す Simulink エントリポイント関数。値の形式は関数の種類に基づきます。
関数の種類 | 値 |
---|---|
初期化 | 'Initialize' . |
リセット | 'Reset: 。ここで、 はモデル内のリセット関数の名前です。 |
終了 | 'Terminate' . |
シングルタスク周期 | 'Periodic' . |
周期 (暗黙的なタスク) | 'Periodic: 。ここで、 は、タイミング凡例に表示される、対応する周期注釈です。例: 'Periodic:D1' 。 |
分割 (明示的なタスク) | 'Partition: 。ここで、 は、スケジュール エディターに表示される、分割名です。例: 'Partition:P1' 。 |
エクスポート |
|
クライアント/サーバー構成の Simulink 関数 | 'SimulinkFunction: 。ここで、 はモデル内のグローバルな Simulink 関数の名前です。たとえば、AUTOSAR サーバーの構成のモデル例の 'SimulinkFunction:readData' 。 |
例: 'Periodic:D1'
出力引数
arRunnableName
— AUTOSAR ランナブルの名前
文字ベクトル
指定した Simulink エントリポイント関数オブジェクトにマッピングされている AUTOSAR ランナブルの名前を返す変数。
例: arRunnableName
arRunnableSwAddrMethod
— 関数 SwAddrMethod
の名前
文字ベクトル
AUTOSAR ランナブル関数に定義されている SwAddrMethod
の名前を返す変数。
例: arRunnableSwAddrMethod
arInternalDataSwAddrMethod
— 内部データ SwAddrMethod
の名前
文字ベクトル
AUTOSAR ランナブル内部データに定義されている SwAddrMethod
の名前を返す変数。
例: arInternalDataSwAddrMethod
バージョン履歴
R2013b で導入
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)