Main Content

mapsignal

地图万博1manbetx块信号到Autosar变量

描述

例子

mapsignal(SLMAP,,,,slPortHandle,,,,Arvartype映射命名或测试的Simulink万博1manbetx®block signal associated with outport port handleslPortHandle到类型的AutoSar变量Arvartype用于汽车运行时校准。Autosar变量类型包括ArtypedperinstancememoryandStaticMemory

mapsignal(SLMAP,,,,slPortHandle,,,,Arvartype,,,,名称,价值指定AutoSar的其他属性ArtypedperinstancememoryorStaticMemory通过使用一个或多个可变名称,价值pair arguments.

例子

全部收缩

为块的Simulink块信号设置AutoSar映射和属性信息万博1manbetxrepoptandin example modelautosar_swc_counter

hmodel ='autosar_swc_counter';addpath(fullfile(matlabroot,'/examples/autosarblockset/main'));open_system(hModel); slMap = autosar.api.getSimulinkMapping(hModel); portHandles = get_param('autosar_swc_counter/relopt',,,,“ Porthandles”);Outporthandle = Porthandles.outport;mapsignal(Slmap,Outporthandle,'StaticMemory')arMappedTo = getSignal(slMap,outportHandle) arValue = getSignal(slMap,outportHandle,“ swcalebrationAccess”)portHandles = get_param('autosar_swc_counter/sum',,,,“ Porthandles”);Outporthandle = Porthandles.outport;mapsignal(Slmap,Outporthandle,'Artypedperinstancemory',,,,...“ swcalebrationAccess”,,,,“ readwrite')arMappedTo = getSignal(slMap,outportHandle) arValue = getSignal(slMap,outportHandle,“ swcalebrationAccess”
arMappedTo = 'StaticMemory' arValue = 'ReadOnly' arMappedTo = 'ArTypedPerInstanceMemory' arValue = 'ReadWrite'

输入参数

全部收缩

万博1manbetxSimulink到AutoSar映射信息的模型,以前由SLMAP= autosar.api.get万博1manbetxSimulinkMapping(模型模型是代表模型名称的句柄,字符向量或字符串标量。

Example:SLMAP

Outport port handle for a named or test-pointed Simulink block signal to set AUTOSAR mapping information for. Use MATLAB®命令来影响ct the outport port handle. For example, for a Relational Operator block namedrepopt

porthandles = get_param('autosar_swc_counter/relopt','porthandles');Outporthandle = Porthandles.outport;

Example:外界

类型的AutoSar变量,以将指定的Simulink块信号映射到。万博1manbetx有效的Autosar变量类型包括Artypedperinstancememory,,,,StaticMemory,,,,andAuto。要接受软件映射默认值,请指定Auto

Example:'StaticMemory'

名称值参数

Specify optional pairs of arguments asname1 = value1,...,namen = valuen, 在哪里姓名是参数名称和Valueis the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

在R2021a之前,请使用逗号分隔每个名称和值,并附上姓名用引号。

Example:“ swcalibrationAccess”,“ readwrite'指定对变量进行运行时校准的读取访问。

为Autosar变量指定显示格式。AutoSar显示格式规格控制校准和测量数据的宽度和精度显示。有关更多信息,请参阅配置DisplayFormat

Example:“ displayformat”,'%2.6F'

指定是否包括C类型预选赛易挥发的在AutoSar变量的生成代码中。

Example:“ iSvolatile',“ true”

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

Example:“预选赛”,“ test_qualifier'

指定AutoSar变量的简短名称。如果未指定,ARXML导出会生成一个简短名称,这与信号名称不同。

Example:'shortname','sm_equal_to_count'

指定swaddrmethodname that is valid for the AUTOSAR variable. Code generation uses theswaddrmethodname to group AUTOSAR variables in a memory section for access by calibration and measurement tools. For a list of validswaddrmethod变量的值,请参阅代码映射编辑器,信号/州标签。有关更多信息,请参阅Configure SwAddrMethod

Example:“ swaddrmethod”,“ var'

Specify how calibration and measurement tools can access the AUTOSAR variable. Valid access values include只读,,,,ReadWrite,,,,and无法访问。有关更多信息,请参阅配置SWCALIBRATIONACCESS

Example:“ swcalibrationAccess”,“ readwrite'

版本历史记录

在R2018B中引入