writeSTIMListData
向指定的测量变量写入
说明
writeSTIMListData(
将指定值写入 XCP 通道上的指定测量变量。xcpch
,measurementName
,value
)
示例
将数据写入激励列表中的测量变量
在虚拟通道上创建一个连接到 Vector CAN 设备的 XCP 通道。设置数据激励列表并向一个 '100ms'
事件的 'Triangle'
测量变量写入。
创建一个对象来解析 A2L 文件并将其连接到 XCP 通道。
a2lfile = xcp.A2L('XCPSIM.a2l') xcpch = xcp.Channel(a2lfile,'CAN','Vector','Virtual 1',1);
将通道连接到服务器。
connect(xcpch)
使用 '100ms'
事件以及 'Bitslice0'
、'PWMFiltered'
和 'Triangle'
测量变量创建一个测量变量列表。
createMeasurementList(xcpch,'STIM','100ms',{'BitSlice0','PWMFiltered','Triangle'});
开始测量。
startMeasurement(xcpch)
将数据写入 'Triangle'
测量变量。
writeSTIMListData(xcpch,'Triangle',10)
输入参数
xcpch
— XCP 通道
XCP 通道对象
XCP 通道,指定为使用 xcpChannel
创建的 XCP 通道对象。随后,该 XCP 通道对象可以与 A2L 文件定义的指定服务器模块通信。
measurementName
— 单个 XCP 测量变量的名称
字符向量 | 字符串
单个 XCP 测量变量的名称,指定为字符向量或字符串。确保 measurementName
与 A2L 文件中定义的对应测量变量名称匹配。
数据类型: char
| string
value
— 测量变量的值
数值
所选测量变量的值,指定为数值。
版本历史记录
在 R2013a 中推出
另请参阅
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)