Main Content

このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。

getFunction

Simulink エントリポイント関数の AUTOSAR マッピング情報の取得

説明

arRunnableName = getFunction(slMap,slEntryPointFunction) は、Simulink® エントリポイント関数 slEntryPointFunction にマッピングされた AUTOSAR ランナブル arRunnableName の名前を返します。

[arRunnableName,arRunnableSwAddrMethod,arInternalDataSwAddrMethod] = getFunction(slMap,slEntryPointFunction) は、マッピングされた AUTOSAR ランナブルに定義された関数および内部データ ソフトウェアのアドレス メソッド (SwAddrMethod) の名前を返します。SwAddrMethod が定義されていない場合、'<None>' が返されます。

すべて折りたたむ

モデル例 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'

モデル例 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 = autosar.api.getSimulinkMapping(model) によって返されたモデルの Simulink から AUTOSAR へのマッピング情報。model は、モデル名を表すハンドル、文字ベクトル、または string スカラーです。

例: slMap

AUTOSAR マッピング情報を返す Simulink エントリポイント関数。値の形式は関数の種類に基づきます。

関数の種類
初期化'Initialize'.
リセット'Reset:slIdentifier'。ここで、slIdentifier はモデル内のリセット関数の名前です。
終了'Terminate'.
シングルタスク周期'Periodic'.
周期 (暗黙的なタスク)'Periodic:slIdentifier'。ここで、slIdentifier は、タイミング凡例に表示される、対応する周期注釈です。例: 'Periodic:D1'
分割 (明示的なタスク)'Partition:slIdentifier'。ここで、slIdentifier は、スケジュール エディターに表示される、分割名です。例: 'Partition:P1'
エクスポート

'ExportedFunction:slIdentifier'。ここで、slIdentifier は Function-Call Subsystem の制御端子を駆動する Inport ブロックの名前です。次に例を示します。

  • モデル例 autosar_swc_slfcns'ExportedFunction:Trigger_1s'

  • モデル例 autosar_swc_fcncalls'ExportedFunction:FunctionTrigger'

クライアント/サーバー構成の Simulink 関数'SimulinkFunction:slIdentifier'。ここで、slIdentifier はモデル内のグローバルな Simulink 関数の名前です。たとえば、AUTOSAR サーバーの構成のモデル例の 'SimulinkFunction:readData'

例: 'Periodic:D1'

出力引数

すべて折りたたむ

指定した Simulink エントリポイント関数オブジェクトにマッピングされている AUTOSAR ランナブルの名前を返す変数。

例: arRunnableName

AUTOSAR ランナブル関数に定義されている SwAddrMethod の名前を返す変数。

例: arRunnableSwAddrMethod

AUTOSAR ランナブル内部データに定義されている SwAddrMethod の名前を返す変数。

例: arInternalDataSwAddrMethod

バージョン履歴

R2013b で導入