J1939 and DLC

RP1210 Development Package and RP1210 Connectivity to PEAK CAN Interfaces
Locked
S.Venet
Posts: 3
Joined: Mon 16. Aug 2021, 13:22

J1939 and DLC

Post by S.Venet » Mon 16. Aug 2021, 14:02

Hello,

I'm using RP1210 API in C++ for a custom application.

When I send a message using RP1210_SendMessage with PGN 59904, I'm expecting to have a DLC of 3, but with a CAN analyser, I have à DLC of 8 with bitstufing by 0x00.

In the API, I can't find anywhere a way to tune the DLC.

As I can read in the standard J1939-21 regarding the PGN 59904 : "Data length: 3 bytes (The CAN frame for this PG shall set the DLC to 3.)"

Can you give me an explanation?

Thanks

M.Heidemann
Sales & Support
Sales & Support
Posts: 1083
Joined: Fri 20. Sep 2019, 13:31

Re: J1939 and DLC

Post by M.Heidemann » Mon 16. Aug 2021, 15:53

Hello,

Thank you for your request.

Please note that the Frame-Size is determined by th buffer size for a given message:
J1939_RP1210.png
J1939_RP1210.png (34.02 KiB) Viewed 4059 times
Seems like your buffer size is the cause for the DLC of your sent frame, check your buffer
size and see if that resolves your issue.

Address claiming could alternatively also be done via the RP1210_SendCommand function ("Protect J1939 Address").

Please let us know if this helped you solve the issue.

Best Regards

Marvin
---
Marvin Heidemann
PEAK-Support Team

S.Venet
Posts: 3
Joined: Mon 16. Aug 2021, 13:22

Re: J1939 and DLC

Post by S.Venet » Tue 17. Aug 2021, 11:14

Thanks for your quick response.

I checked the size of the data put into the fpchClientMessage parameter, it is 9 bytes long, according to what is specified in documentation.

This parameter is a scruture composed of :

unsigned char PGN[3]; //3 bytes
unsigned char priority; //1 byte
unsigned char SA; //1 byte
unsigned char DA; //1 byte
unsigned char pgn_data[3]; //3 bytes

Parameter nMessageSize = sizeof(struct) = 9, so I expect to have a DLC of 3 (9 - 6).

I use PCan Net Configuration tool to tune my network, is there any specific configuration to do at this level?

Thanks for your help.

S.Venet
Posts: 3
Joined: Mon 16. Aug 2021, 13:22

Re: J1939 and DLC

Post by S.Venet » Tue 17. Aug 2021, 11:34

I have just find the issue : you were rigth, this is an issue on the message size, a regression has been recently introduced by another member of the team.

Thanks for tour help.

Locked