I Need help with SAE J1939 Protocol Implementation

Hello guys! :wave:

My current project entails putting the SAE J1939 vehicle communication protocol into practice. I was hoping to obtain some guidance from others who have expertise with this regimen because I have run into a few obstacles.

Specifically, I am having trouble with the following:

Which protocols should be followed to guarantee prompt and dependable message delivery across the J1939 network? Are there any particular settings or time parameters I should be aware of?

Could anyone provide insights on efficiently managing Parameter Group Numbers (PGNs) and Suspect Parameter Numbers (SPNs)? Any tips on organizing and accessing this data effectively?

I need to implement diagnostic communication as per the J1939 standard. What are the common pitfalls to avoid, and how can I ensure compliance with the standard?

I also check this: https://www.sae.org/binaries/content/assets/cm/content/standards/enewsletters/gv-marqlikview But I have not found any solution. Could anyone provide me the best solution for this?

Thank you :smiling_face:

Respected community member :smiling_face_with_three_hearts:

Hello Georgia,
I assume you are about to implement the J1939-21 (CAN CC) protocol layer. You may use for the most Parameter Groups (PGs) a single CAN message. In case the length of a PG exceeds 8 byte you need to implement a transport protocol. This is either RTS/CTS or BAM. All message services are considered reliable with respect to CAN. If an implementation can handle all received message in time is a different question. To adjust the delay of a message delivery you have to carefully manage the priority of each CAN message by means of the PG’s priority field. Since most of the J1939 messages are broadcast and cyclic an application should be robust enough to survive a single message lost and wait for the next message. In case of a message is sent to a specific destination the receive most likely provides an acknowledge. This will helpt the sender of a message to see if the message transport was successfull.
To avoid issues you should consider to implement dynamic address management as described in the -81 document. An effective way to handle PGs/PGNs in you software is to use a hash algorithm. For compatibility issues you should consider -82 document and follow the checks precisely.
A general free of charge online training for J1939 fundamentals can be found here: Vector eLearning. You may also check our CANoe.J1939 which includes a compliance test, based on SAE documents CANoe.J1939.