主要内容

mapParameter

地图万博1manbetx模型工作区参数to AUTOSAR component parameter

描述

example

mapParameter(slMap,slParameter,Arparamtype)maps the Simulink®模型工作区参数slParameter到类型的自动赛参数Arparamtypefor AUTOSAR run-time calibration. AUTOSAR parameter types include共享参数,PerinstanceParameter,常数, 和PortParameter.

mapParameter(slMap,slParameter,Arparamtype,Name,Value)specifies additional properties for an AUTOSAR共享参数,PerinstanceParameter,常数, orPortParameter通过使用一个或多个Name,Value配对参数。

例子

全部收缩

Set AUTOSAR mapping and property information for Simulink model workspace parameters K and INC in example modelautosar_swc_counter.

hModel ='autosar_swc_counter'; addpath(fullfile(matlabroot,'/示例/autosarblockset/main')); open_system(hModel); slMap = autosar.api.getSimulinkMapping(hModel); mapParameter(slMap,'K',“共享参数”) arMappedTo = getParameter(slMap,'K') arValue = getParameter(slMap,'K','SwCalibrationAccess') mapParameter(slMap,'INC',“常数”,'SwCalibrationAccess','ReadOnly') arMappedTo = getParameter(slMap,'INC') arValue = getParameter(slMap,'INC','SwCalibrationAccess')
arMappedTo = 'SharedParameter' arValue = 'ReadWrite' arMappedTo = 'ConstantMemory' arValue = 'ReadOnly'

Input Arguments

全部收缩

Simulink to AUTOSAR mapping information for a model, previously returned byslMap= autosar.api.getSimulinkMapping(model).modelis a handle, character vector, or string scalar representing the model name.

例子:slMap

Name of the Simulink model workspace parameter for which to set AUTOSAR mapping information.

例子:'INC'

Type of AUTOSAR component parameter to which to map the specified Simulink model workspace parameter. Valid AUTOSAR parameter types include共享参数,PerinstanceParameter,常数,PortParameter, 和汽车. To accept software mapping defaults, specify汽车.

例子:“共享参数”

Name-Value Arguments

将可选的参数对Name1=Value1,...,NameN=ValueN, whereNameis the argument name and价值是相应的值。名称值参数必须在其他参数之后出现,但是对的顺序并不重要。

Before R2021a, use commas to separate each name and value, and encloseNamein quotes.

例子:'SwCalibrationAccess','ReadOnly'指定仅读取对运行时校准的参数的访问。

指定在AutoSar字典中配置的参数接口数据元素的名称。

例子:“ dataElement','paramelement1'

Specify display format for the AUTOSAR parameter. AUTOSAR display format specifications control the width and precision display for calibration and measurement data. For more information, seeConfigure DisplayFormat.

例子:'DisplayFormat','%2.6f'

Specify whether to include C type qualifierconstin generated code for the AUTOSAR parameter.

例子:'isConst','true'

Specify whether to include C type qualifiervolatilein generated code for the AUTOSAR parameter.

例子:'IsVolatile','true'

Specify the name of a parameter receiver port configured in the AUTOSAR Dictionary.

例子:'Port','myParamPort'

可选地指定AutoSar附加类型的预选赛,以在AutoSar参数的生成代码中包含。

例子:'Qualifier','test_qualifier'

指定SwAddrMethod对AutoSar参数有效的名称。代码生成使用SwAddrMethodname to group AUTOSAR parameters in a memory section for access by calibration and measurement tools. For a list of validSwAddrMethod参数的值,请参阅代码映射编辑器,Parameterstab. For more information, see配置swaddrmethod.

例子:'SwAddrMethod','CONST'

Specify how calibration and measurement tools can access the AUTOSAR parameter. Valid access values includeReadOnly,ReadWrite, 和NotAccessible. For more information, seeConfigure SwCalibrationAccess.

例子:'SwCalibrationAccess','ReadOnly'

Version History

Introduced in R2018b