CANAPE中加载DBC后,如何在脚本中获取到DBC内的信号量

Question:

How to access CAN signals when the signal name exists more than one time?

Answer:

In the DBC file a CAN signal exists more than one time with different CAN message IDs. To access this signal via a script/function you have to use the message and the signal name.

Syntax for working with CAN devices:

value = <Device_ID>.'$<Message_Name>$<Signal_Name>'.mbuffer[0];

Example:

In this example, the Device ID is "Vin". Both CAN messages "VIN1" and "VIN3" include the CAN signal "Kanal1".

var value, value2;
value = Vin.'$VIN1$Kanal1'.mbuffer[0];
value2 = Vin.'$VIN3$Kanal1'.mbuffer[0];

Syntax for working with MDF files:

<File_ID>[[.<Channel_Number>].<Message_Name>]].<Signal_Name>

Example:

In this example, the name of the file is "FILE1". The message name is "VIN1", and the channel number is "1".

value = FILE1.Kanal1;
value = FILE1.VIN1.Kanal1;
value = FILE1.1.VIN1.Kanal1;

Please note, that Channel Number and Message Name are additional and optional.

  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值