readCharacteristic
从直接内存中读取并缩放指定的特征值
说明
通过 XCP 通道对象 value
= readCharacteristic(chanObj
,characteristic
)chanObj
读取并缩放指定 characteristic
的值。此操作直接从服务器模块的内存中读取。
示例
从 XCP 通道特征变量读取值
从 XCP 通道特征变量读取值,按名称标识要读取的特征变量。
a2lObj = xcpA2L('myA2Lfile.a2l'); chanObj = xcpChannel(a2lObj,'CAN','Vector','Virtual 1',1); connect(chanObj); value = readCharacteristic(chanObj,'torque_demand');
或者,创建一个特征变量对象并读取其值。
charObj = a2lObj.CharacteristicInfo('torque_demand');
value = readCharacteristic(chanObj,charObj);
输入参数
chanObj
— XCP 通道
通道对象
XCP 通道,指定为 XCP 通道对象。
示例: xcpChannel()
characteristic
— XCP 通道特征变量
特征变量对象 | 字符
XCP 通道特征变量,指定为字符向量或特征变量对象。
示例: 'torque_demand'
数据类型: char
输出参量
value
— 从特征变量读取的值
特征变量值
从特征变量读取的值,以特征变量支持的类型形式返回。
版本历史记录
在 R2018a 中推出
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)