CAN Bus Programming

Thread Starter

john2k

Joined Nov 14, 2019
219
I'm currently testing sending CAN Messages to a Lexus instrument cluster. Some of the messages have data length of 8 which looks something like this

15 00 00 44 00 00 00 00

The first byte where I have 15 is supposed to be RPM. Can anyone tell me if RPM is calculated in a standard way and what the formula for calculate the RPM value would be?

If I wanted to to try out different variations in each byte, how many different variations are there? I am assuming it starts with 00 to 99 and then there are letter combinations too right?
 

djsfantasi

Joined Apr 11, 2010
9,156
I'm currently testing sending CAN Messages to a Lexus instrument cluster. Some of the messages have data length of 8 which looks something like this

15 00 00 44 00 00 00 00

The first byte where I have 15 is supposed to be RPM. Can anyone tell me if RPM is calculated in a standard way and what the formula for calculate the RPM value would be?

If I wanted to to try out different variations in each byte, how many different variations are there? I am assuming it starts with 00 to 99 and then there are letter combinations too right?
Are you sure that the data stream is decimal? I would assume that it’s actually hex. Meaning the values would be in the range of 00-FF or 0-255 decimal. Hence, 15 hex is 21 decimal.
 

Papabravo

Joined Feb 24, 2006
21,159
CAN messages are a maximum of 8 bytes in length. The actual data length can be fro zero to 8 bytes. There is also an 11-bit or 29-bit identifier field. The syntax and semantics of the data field is probably dependent on the content of the identifier field. I don't think you have much chance of discovering useful information with your current approach. AS for RPM, every manufacturer does it differently -- by design. At least that's what my friends at FCA say.
 

Thread Starter

john2k

Joined Nov 14, 2019
219
Are you sure that the data stream is decimal? I would assume that it’s actually hex. Meaning the values would be in the range of 00-FF or 0-255 decimal. Hence, 15 hex is 21 decimal.
I'm not sure of anything, it's just trial and error at the moment LOL. For example I have the following data string which works

1B 19 56 55 70 50 56 55

The first two characters show a visual diagram of parking sensor on the cluster and report that parking sensor system is OK. The second byte that says 19 is parkin sensors on. If it's off this value is 18 and the rest is how many stripes to show on the parking sensor. You say that if its decimal then it would be 0-255. But looking at a log of sniffed data, all the data seems to be in 2 characters length each. So it's either two digits or a mix of letters. Does that mean the data stream is all in hex? so what will be the options from 00-FF to try?
 

djsfantasi

Joined Apr 11, 2010
9,156
The digits 0-9 and A-F form a hex number. A pair of characters from this set is needed to form a byte.

In one byte, you can represent a decimal number from 0-255. Or two hexadecimal characters. Note that what we are talking about here are different representations of a character or byte. The internal representation is the same. Externally, it depends on how you decide to represent it.
 

djsfantasi

Joined Apr 11, 2010
9,156
I'm not sure of anything, it's just trial and error at the moment LOL. For example I have the following data string which works

1B 19 56 55 70 50 56 55

The first two characters show a visual diagram of parking sensor on the cluster and report that parking sensor system is OK. The second byte that says 19 is parkin sensors on. If it's off this value is 18 and the rest is how many stripes to show on the parking sensor. You say that if its decimal then it would be 0-255. But looking at a log of sniffed data, all the data seems to be in 2 characters length each. So it's either two digits or a mix of letters. Does that mean the data stream is all in hex? so what will be the options from 00-FF to try?
So, 0x19 (that’s how we show hex numbers) is 25 decimal. That is:

1 x 16 = 16
9 x 1 = 9 = 25

So, 0x18 is 24 decimal.

Going one character further, 0x56 is 86 decimal. Once more, that is:

5 x 16 = 80
6 x 1 = 6 = 86

Get it?
 
Top