I’m trying to translate the bit positions I have in my DBC file to how startbit and bitcount has been implemented in Realdash CAN XML.
in Realdash are the bit’s numbered as the table below? for example if I was looking at offset=“4” and length=“1” this would be equivalent to startbit=“39” and bitcount=“8” or does it count left to right i.e. startbit=“32” and bitcount=“8”?
|0 | 7| 6| 5| 4| 3| 2| 1| 0|
|1 |15|14|13|12|11|10| 9| 8|
|2 |23|22|21|20|19|18|17|16|
|3 |31|30|29|28|27|26|25|24|
|4 |39|38|37|36|35|34|33|32|
|5 |47|46|45|44|43|42|41|40|
|6 |55|54|53|52|51|50|49|48|
|7 |63|62|61|60|59|58|57|56|
then based on the answer above, the next part of my question is; i’m trying to get a 12bit number, basically the second nibble for offset 4 and the value of offset 5, the DBC says bitpos=40 len=12, this means (in the above table) start at bit 40 and count back 12 (to 35)
I have tried this, but i’m not getting the correct value for RPM (I’m setting endianess=“big” for the frame)
> <value targetId="37" offset="4" length="2" conversion="((B4 & 0xF << 8) | B5) * 2"></value> <!-- RPM 40/12-->
if I have understood what I have already read in the forum’s this should be taking the value in byte 4, masking the last 4 digits, and then appending the value form byte 5 (bitOR), the *2 is the factor
I hope i’m on the right track I have already got loads of data in, i’m just struggling with any value greater than a single byte.
Hope this all makes sense, an oppogies if all this has been covered elsewhere, I did try looking!!
Thanks