Accessing CAN Signal that Exists Several Times

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.



Article ID: 21
Last updated: 2018-10-10
Revision: 7
CANape -> Data Analysis -> Scripts and Functions -> Accessing CAN Signal that Exists Several Times
https://kb.vector.com/entry/21/