How does Raw Mapping Offset and Bytes work?

Discussion and research on OBDII integration, especially on OEM specific PIDs from Ford, GM, Chevrolet, BMW, Porsche, Audi, Toyota, Volkswagen, Mazda, Honda, Subaru, Mitsubishi and others.
Post Reply
ncrx
Posts: 2
Joined: Mon Oct 29, 2018 4:45 pm

How does Raw Mapping Offset and Bytes work?

Post by ncrx »

Hi,

I've read through the obd mapping guides and trying to understand how offset and bytes work.

I am looking to get AF ratio to display from my 06 s2000 with a RC Pro Mk2. The 06 model has canbus , but i'm trying to get A/F over obd.

I looked through this wiki with obd pids https://en.wikipedia.org/wiki/OBD-II_PIDs
Pid 14 and 24 are what i'm interested in.

PID 14 is o2 sensor 1, with 2 bytes. A value is voltage, B value is short term fuel trim
PID 24 is 02 sensor 1, with 4 bytes. AB fuel-air equivalence ratio, CD: voltage
Image

Now when i configure RCP on the raw value mapping for PID 14
for offset 4, bytes 2 it gives me a static value
I tinkered a bit and set offset to 3, bytes 1 it gives me a dynamic value

Can someone explain to me what is happening when choosing the different offset and bytes?

The above case is for 2 bytes data, what about for PID24 with 4 bytes? What offset should i be using?

Thanks
Nick

GTIspirit
Posts: 249
Joined: Wed Jan 09, 2013 11:20 am
Location: SE Michigan

Re: How does Raw Mapping Offset and Bytes work?

Post by GTIspirit »

I haven't tried any PID mapping so this is a more general answer.

Offset is basically the distance from origin, in bytes. So if the information you want resides in the second byte, Byte 1 (numbering typically starts with 0), and is only one byte long, the offset would be 1 and length 1. A more detailed explanation can be found here:

https://www.motec.com.au/forum/viewtopi ... =70&t=3436

Looking at the chart in the link you referenced, PID 14 is only 2 bytes long. (Not sure what information is in Byte 3 or 4). So if you want voltage from PID 14 try offset 0 and length 1.

PID 24 is a bit more complicated because information stretches over multiple bytes. If you want Air Fuel Equivalence, try offset 1 length 2. (One byte above 0, 2 bytes long). Since it's more than one byte you may have to consider Big Endian vs Little Endian, or Intel vs Motorola. Which is basically, in which direction goes the counting?

brentp
Site Admin
Posts: 6282
Joined: Wed Jan 24, 2007 6:36 am

Re: How does Raw Mapping Offset and Bytes work?

Post by brentp »

Hi, we have a very comprehensive guide here on how the CAN mapping works - also applies to the OBDII mapping as well:
https://wiki.autosportlabs.com/CAN_Bus_Integration

We also have a dedicated guide just for OBDII:
https://wiki.autosportlabs.com/RC_OBDII

Thanks!

ncrx
Posts: 2
Joined: Mon Oct 29, 2018 4:45 pm

Re: How does Raw Mapping Offset and Bytes work?

Post by ncrx »

brentp wrote: Sat Aug 29, 2020 7:20 pm Hi, we have a very comprehensive guide here on how the CAN mapping works - also applies to the OBDII mapping as well:
https://wiki.autosportlabs.com/CAN_Bus_Integration

We also have a dedicated guide just for OBDII:
https://wiki.autosportlabs.com/RC_OBDII

Thanks!
Thanks figured it out!

I forgot to convert the hex value to decimal for PID. Once i did that it all started to work.

Was able to find lambda on PID34 (Decimal 52). Just needed to divide it by 32768 and multiply it by 14.7 to get AFR.

If I log the can stream, would i be able to find the matching value being out on PID34?
The formula for pid34 is ((A*256)+B)/32768. Would the data be split out as A and B, or would it be matching the raw value over obd?

This is for a 2006 honda s2000 with canbus.

Post Reply