Handling 29-Bit (Extended) Format

@egarl004 and @cyclin_al1,

Sorry for the late reply, just saw your messages now. This is what I needed to use to construct the request message:

CANMessage message;
message.id = 0x18DB33F1;
message.len = 8; // message will always be 8 bytes
message.extended = true;
message.data[0] = 0x02; // 2 bytes of data in message
message.data[1] = 0x01; // Get current data
message.data[2] = pid; // The PID to retrieve (replace with appropriate hex value for the PID)
message.data[3] = 0x09; // Not sure why, but the last 5 bytes need to be set this way
message.data[4] = 0x13;
message.data[5] = 0x00;
message.data[6] = 0x20;
message.data[7] = 0xE0;

When waiting for the response, a quick way to filter out most/all of the garbage is to just look for anything with an ID above 7DF:

const auto REPLY_ID_MIN = 0x7DF;
if (replyMessage.id >= REPLY_ID_MIN)
{
// Probably the response; log detailsā€¦
}

My vehicle never seems to send messages above 7DF unless itā€™s a diagnostic response. You can probably also use the canFilter() method to limit the received messages but I couldnā€™t tell you offhand how to populate it in this case.

Hope this helps.

Mike

Iā€™m having a similar issue. Iā€™ve coded now for both 11 bit and 29 bit messages - thanks for the heads-up and the information. That said, Iā€™m a bit concerned/puzzled by the need for 5 bytes with specific data. Is this detail documented somewhere?

Hi @alanm I have gone through this post. Based on your post i understand what are the CAN request and CAN response identifer for 11 bit. Similiar to the 11 bit is there any standard CAN request and CAN response identifier for 29-bit which will supports all kind of heavy duty vehicles like trucks,buses etc.

1 Like

Cool - glad to hear it is helpful! For Heavy Duty vehicles you should look into the SAE J1939 standards to determine how to request diagnostic data. It is a completely different standard than OBD-II

Hi @alanm thanks for your reply.I have gone through the SAE J1939 standard document,but i am not getting any document which will helps me . If you have any sample document for 29 -bit identifiers with Request and response and what is the range of identifier which will use most of the OEMā€™s,Please provide it gonna help a lot for me.
Thanks in advance.

Understanding SAE J1939