このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。
mapFunction
Simulink エントリポイント関数を AUTOSAR ランナブルおよびソフトウェアのアドレス メソッドにマッピング
構文
説明
mapFunction(
は、Simulink® エントリポイント関数 slMap
,slEntryPointFunction
,arRunnableName
)slEntryPointFunction
を AUTOSAR ランナブル arRunnableName
にマッピングします。
mapFunction(
では、1 つ以上の slMap
,slEntryPointFunction
,arRunnableName
,Name,Value
)Name,Value
ペアの引数を使用して AUTOSAR ランナブルに追加のプロパティを指定します。ランナブル関数コードと内部データにソフトウェアのアドレス メソッド (SwAddrMethod
) を指定できます。
例
Simulink エントリポイント関数の AUTOSAR マッピング情報の設定
モデル例 autosar_swc
の Simulink エントリポイント関数の AUTOSAR マッピング情報を設定します。このモデルには、Runnable_Init
という名前の初期化エントリポイント関数と、Runnable_1s
および Runnable_2s
という名前の周期エントリポイント関数があります。
hModel = 'autosar_swc'; openExample(hModel); slMap=autosar.api.getSimulinkMapping(hModel); mapFunction(slMap,'Initialize','Runnable_Init'); 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 ランナブルの名前
文字ベクトル | string スカラー
指定された Simulink エントリポイント関数オブジェクトのマッピング先となる AUTOSAR ランナブルの名前。
例: 'Runnable_2s'
名前と値の引数
オプションの引数のペアを Name1=Value1,...,NameN=ValueN
として指定します。ここで、Name
は引数名、Value
は対応する値です。名前と値の引数は他の引数の後に配置しなければなりませんが、ペアの順序は重要ではありません。
R2021a より前では、コンマを使用して各名前と値を区切り、Name
を引用符で囲みます。
例: 'SwAddrMethod','CODE'
は、AUTOSAR ランナブル関数の SwAddrMethod
CODE
を指定します。
SwAddrMethod
— 関数 SwAddrMethod
の名前
文字ベクトル | string スカラー
AUTOSAR 関数で有効な SwAddrMethod
名を指定します。コード生成では SwAddrMethod
名を使用して、メモリ セクションに AUTOSAR ランナブル関数をグループ化します。関数の有効な SwAddrMethod
値のリストについては、コード マッピング エディターの [エントリポイント関数] タブを参照してください。詳細については、SwAddrMethod の設定を参照してください。
例: 'SwAddrMethod','CODE'
SwAddrMethodForInternalData
— 内部データ SwAddrMethod
の名前
文字ベクトル | string スカラー
AUTOSAR 内部データで有効な SwAddrMethod
名を指定します。コード生成では、SwAddrMethod
名を使用して、メモリ セクションで AUTOSAR ランナブル内部データをグループ化します。内部データの有効な SwAddrMethod
値のリストについては、コード マッピング エディターの [エントリポイント関数] タブを参照してください。詳細については、SwAddrMethod の設定を参照してください。
ランナブル内部データ SwAddrMethod
のコード生成では、モデル コンフィギュレーション オプション [コード生成] 、 [インターフェイス] 、 [エントリポイント関数ごとに個別の内部データを生成] (GroupInternalDataByFunction
) を on
に設定します。
例: 'SwAddrMethodForInternalData','VAR'
バージョン履歴
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)