CAN protocol supports transfer of 8 bytes of data in one frame. What if you want to transfer large data? SAE J1939/21 specifications defines fragmented transmission of large data known as transport protocol (TP). TP sends message of more than 8 bytes of data in multiple packets. SAE J1939/21 specifications defines various network services, message requests and acknowledgment. it defines format of frames, sending, handshaking and reassembling of packets.
Table of Contents
SAE J1939 TP supports sending data to global destination address (BAM) and sending data to specific destination (CM). Data transfer part is similar in both the ways, they differ in how they start and how fast data is transferred.
SAE J1939 TP use two specific parameter groups for fragmented transmission of large data. First is transport protocol connection management message (TP.CM); it contains connection command, PGN identifier of the TP message and information about how to reconstruct the message. Second is transport protocol data transfer message (TP.DT); it contains sequence number in first byte and 7 bytes of data. A maximum of 1785 bytes can be transferred using transport protocol.
Broadcast Announce Message Transport Protocol (BAM TP)
BAM TP messages are intended for complete network, so there is no handshake messages required. The sender starts with sending TP.CM message with command BAM (32) and then sender send all the data through TP.DT messages untill all data is sent. The transmitter sends all data TP.DT messages at a minimum interval of 50 ms.
BAM TP.CM Message
PGN: 60416 (0xEC00)
Priority: 7
Length: 8 bytes
Destination: Global (255)
Byte 1: BAM (32)
Byte 2 and 3: Message size in bytes
Byte 4: Number of packets
Byte 5: Reserved (0xff)
Byte 6 to 8: PGN
BAM TP.DT Message
PGN: 60160 (0xEB00)
Priority: 7
Length: 8 bytes
Destination: Global (255)
Byte 1: Sequence number (1 to 255)
Byte 2 to 8: Data
Below example shows transmission of BAM TP messages for PGN 65260 (0xFEEC) with 17 bytes of data.
TP.CM message
Time in ms
PGN
Destination
Byte 0
Byte 1
Byte 2
Byte 3
Byte 4
Byte 5
Byte 6
Byte 7
0
60416
255
32
18
0
3
255
236 (0xEC)
254 (0xFE)
0
TP.DT message 1
Time in ms
PGN
Destination
Byte 0
Byte 1
Byte 2
Byte 3
Byte 4
Byte 5
Byte 6
Byte 7
50
60160
255
1
Data byte 1
Data byte 2
Data byte 3
Data byte 4
Data byte 5
Data byte 6
Data byte 7
TP.DT message 2
Time in ms
PGN
Destination
Byte 0
Byte 1
Byte 2
Byte 3
Byte 4
Byte 5
Byte 6
Byte 7
100
60160
255
2
Data byte 8
Data byte 9
Data byte 10
Data byte 11
Data byte 12
Data byte 13
Data byte 14
TP.DT message 3
Time in ms
PGN
Destination
Byte 0
Byte 1
Byte 2
Byte 3
Byte 4
Byte 5
Byte 6
Byte 7
150
60160
255
3
Data byte 15
Data byte 16
Data byte 17
255
255
255
255
Destination Specific Transport Protocol (CM TP)
Peer to peer or CM TP contains handshaking to guarantee successful data transfer. The sender starts with a “request to send” (RTS) message. The receiver then controls the TP communication with “clear to send” (CTS) messages and finally ends TP session with “end of message acknowledge”. The data of the TP.CM Clear to Send message contains the current sequence number to transfer as well as the number of TP.DT packets allowed. The originator then sends TP.DT messages starting at the sequence requested and stops after reaching the number of TP.DT messages allowed. This process continues until all the data is transferred. The receiving device then has to send a TP.CM message with command byte EndofMsgACK confirming that all the data was successfully received.
RTS TP.CM Message
PGN: 60416 (0xEC00)
Priority: 7
Length: 8 bytes
Destination: Specific
Byte 1: RTS (16)
Byte 2 and 3: Message size in bytes
Byte 4: Number of packets
Byte 5: Total number of packet sent in response to CTS.
Byte 6 to 8: PGN
CTS TP.CM Message
PGN: 60416 (0xEC00)
Priority: 7
Length: 8 bytes
Destination: Specific
Byte 1: CTS (17)
Byte 2: Max number of packets that can be sent at once. (Not larger than byte 5 of RTS)
Byte 3: Next sequence number to start with
Byte 4 and 5: Reserved (0xff)
Byte 6 to 8: PGN
End of Message Acknowledge TP.CM Message
PGN: 60416 (0xEC00)
Priority: 7
Length: 8 bytes
Destination: Specific
Byte 1: EndofMsgACK (19)
Byte 2 and 3: Total message size in bytes
Byte 4: Total number of packets
Byte 5: Reserved (0xff)
Byte 6 to 8: PGN
Connection Abort Message TP.CM Message
PGN: 60416 (0xEC00)
Priority: 7
Length: 8 bytes
Destination: Specific
Byte 1: Connection abort (255)
Byte 2 and 3: Connection abort reason
Byte 3 to 5: Reserved (0xff)
Byte 6 to 8: PGN
Below example shows transmission of CM TP messages for PGN 65260 (0xFEEC) with 17 bytes of data.
Mohan is an embedded system engineer by profession. He started his career designing and writing code for consumer electronics, industrial automation and automotive systems. Mohan is working in automotive electronics since last 19 years. He loves working at the hardware software interfaces.
Mohan has Master of Science in Instrumentation from University of Pune and Masters of Technology in embedded systems from Birla Institute of Technology and Science, Pilani, India.
Thanks for information.How I can implement it in MATLAB Simulink.I have to transmit more than 8 bytes of data through one CAN ID.As I tried to use J1939 communication blocks,I can’t use one identifer for different PGNs.Please give me suggestion
hi Suraj,
I never implemented J1939 in MATLAB Simulink. We are using custom developed CAN J1939 driver.
You can not use the same identifier for different PGNs. Basically your PGN is translated into identifier, means every PGN represent different identifier.
I hope this helps.
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional
Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
Thanks for information.How I can implement it in MATLAB Simulink.I have to transmit more than 8 bytes of data through one CAN ID.As I tried to use J1939 communication blocks,I can’t use one identifer for different PGNs.Please give me suggestion
hi Suraj,
I never implemented J1939 in MATLAB Simulink. We are using custom developed CAN J1939 driver.
You can not use the same identifier for different PGNs. Basically your PGN is translated into identifier, means every PGN represent different identifier.
I hope this helps.