04-20-2023 02:01 AM
R/All
I am reading vehicle ECU data (CAN bus) through serial module - 3onedata CAN232.
I am getting values in labview as Hex, Code shown in image attached.
But I am not able to interpet/convert the data as shown in dbc file attached vehicle EOL testing.txt (can convert to .dbc and read in CANdb software)
This file is generated in another software directly reading CAN data.
My queries are,
1. How to give proper sytax to read data in labview?
2. I want to use some data for calculation like voltage and current, how to find the particular data in the serial read if it stays in hex?
3. Serial read data changes every time, how to gather and manipulate data for query 1 & 2?
Solved! Go to Solution.
04-20-2023 04:47 AM
Hi vaibhavsl,
so what do you know about CAN communication? Heard of long/short ArbID, message payload and so on?
Can you read and understand dbc files from reading at the text file (or using a DBC editor like CANdb++)?
Example:
BO_ 1034 Battery_1_40A: 8 Vector__XXX
SG_ current_sign1 : 23|1@0+ (1,0) [0|1] "" Vector__XXX
SG_ Battery_Current_Pack_1 : 22|31@0+ (0.01,0) [0|21474836.47] "mA" Vector__XXX
Read the manual for your CAN interface to learn how to read message by message (or blocks of messages) correctly. There you should also find an explanation on how to separate signal values from message payload…
04-24-2023 04:01 AM
R/All
I am using a follwoing program to hex data string (file trimmed for size to attach) to convert it into number which i got normal text.
This is CAN bus data. I am attaching CAN bus read file in hex format too. Also CAN bus DBC file is attached.
1. I am not sure while for calculation from data, whether for 8 bits i can directly take 4bits of HEX. ( open as CAN bus DBC file.dbc)
2. Or should i take 2 bits of HEX while data manipulation and add next bits?
3. I want take only fix bits from dbc to read current and voltage for each battery pack. Which are shown in DBC viewer.
04-24-2023 04:13 AM
04-24-2023 05:22 AM - edited 04-24-2023 06:04 AM
Hi vaib,
please don't send PMs, post all your questions (and data) in the forum. And please stick with your thread instead of creating multiple threads for the same problem!
See this:
It's a very basic way of converting CAN data to meaningful values…
(I'm not sure I'm implemented the conversion correctly as I don't have a CAN-DBC editor available right now. I just implement based on experience and memory. Are the values in the image resonable?)
General suggestion:
Don't convert the CAN data to hex-formatted ASCII strings, but handle the message payload data as U8 array (or as U64 entity when you work with default CAN messages)!