To help further, I would need to have more details of how your CAN frame data looks like and what are the bits you are trying to read from the frame. Try to use the CAN monitor to get a snapshot of frame values and pinpoint where the interesting data is.
Since the value with pedal at 100% = 0011 1110 1000, it makes sense the value should be v/10. I didn’t change the CAN monitor to BIG ENDIAN, so just reminding you. I highlighted the values that change in binary.
This is somewhat tricky as big endian to little endian bytes are in a ‘wrong side’ of each other. I think best way to handle this is to use individual bytes in conversion:
In above example, I take value of first byte, mask it by 0x3 (use only lowest 2 bits), bitshift to the left by 8. Then I do bitwise or with second byte and apply 0.1 scale.
First off, this worked for this situation so thanks.
I’ve been adding more IDs and I think I had some issues due to the byte numbering.
If you use the example above and have offset 3, length 2, would you use “B3 | B4” or “B0 | B1”?
I changed to latter and it looks like my data is correct now. Just wanted to make sure I understand this because I’m going to try and modify the DBCtoXML conversion.
Also, a lot of people have asked for Ford XML files. I can send mine when I finish if you want to incorporate it. However, Ford modifies their CAN IDs slightly between models so it probably won’t work for all Fords.