Understanding SAE J1939

SAE J1939 is a standard defined by the Society of Automotive Engineers (SAE J1939) specifically designed to provide serial data communications between microprocessor systems.

Although CAN existed and was widely used for smaller vehicles, SAE J1939 was designed as a dedicated communication and diagnostics protocol for the complex networks of huge vehicles. J1939 is commonly used in heavy-duty vehicles such as trucks, tractors, trailers, agriculture vehicles, marine, aid and rescue and many such off-road vehicles. Today it is widely recognised by diesel engine manufactures across the world.

J1939

SAE J1939 is a Higher Layer Protocol (HLP) based on Controller Area Network (CAN), a specialised internal communication network that interconnects components inside a vehicle.  Just as the CAN bus serves as the hardware for this communication, J1939 can better be understood as the language used it. SAE J1939 has successfully replaced the previously existing SAE J1708 and J1587 standards. It has become the standard method of communication amongst multiple manufacturers, providing not just the set communication standards, but J1939 also: -   

  • Specifies how to handle multi-packet messages.

  • Enable communication across large complex networks.

  • Specifies how to convert data into human-readable information.

  • Defines diagnostics interface of its own.

SAE J1939 is a Higher Layer Protocol (HLP) based on Controller Area Network (CAN), a specialised internal communication network that interconnects components inside a vehicle.  Just as the CAN bus serves as the hardware for this communication, J1939 can better be understood as the language used it. SAE J1939 has successfully replaced the previously existing SAE J1708 and J1587 standards. It has become the standard method of communication amongst multiple manufacturers, providing not just the set communication standards, but J1939 also: -   

J1939 Layers

The standard CAN Bus supports 11- bit or 29-bit message IDs at almost every baud rate up to 1 Mbps. In contrast, SAE J1939 is limited to a 29-bit message identifier at 250 or 500 kbps(max). This is to assure maximum reliability on J1939. But it can support messages greater than 8 data bytes. Most J1939 messages are broadcast(BAM) on the CAN, but some data is only available by requesting(CM) the data via the CAN bus(explained later in the article). J1939 messages are identified by 18-bit Parameter Group Numbers (PGN), while J1939 signals are called Suspect Parameter Numbers (SPN). PGNs with up to 1785 bytes are supported via the J1939 transport protocol.

If we get into the details of this, the figure below should draw a clear picture of how a 29 Bit CAN identifier is expressed in the SAE J1939 message format.

If we get into the details of this, the figure below should draw a clear picture of how a 29 Bit CAN identifier is expressed in the SAE J1939 message format.

J1939 message format.png

Here,

  • Start of frame (SOF): as defined in CAN, marks the beginning of the frame and is always a dominant 0.

  • Remote Request Bit (RTR): always set a dominant 0 in SAE J1939.

Other fields are as defined in the CAN standard. What is of interest here is that all J1939 packets (except for the request packet) contain eight bytes of data and a standard header containing an index called Parameter Group Number (PGN), embedded in the message’s 29-bit identifier. Parameter Group Number (PGN) refers to the value of the Reserve bit, Data Page, PDU Format, and PDU Specific fields (combined into a single 18-bit value).

The 29-bit identifier used in the J1939 structure is represented in the way given below. Here, PDU stands for Protocol data unit, and that is the message format.

Message format of J1939.png
  • Priority: Controls a message’s priority during the arbitration process. A “0” value holds the highest priority, typically given to high-speed control messages. For example, the messages coming from brakes will always prioritise messages coming from the vehicle’s ambient temperature.

 

  • Extended Data Page and Data Page: These bits are included in the PGN for counting as the most significant bit. The data page bit expands the number of possible Parameter Groups that the identifier can represent. The numeric range is arranged in the following four pages: -

J1939 Table.PNG
  • PDU format: Determines whether the message is to be transmitted with a destination address or if always transmitted as a broadcast message.

 

  • PDU Specific: The PDU specific field changes based on the PDU Format value:

PDU format lies from 0 to 239: -

  • Then the message is addressable, and the PDU specific field contains the destination address. It specifies peer-to-peer communication (CM).

  • The parameter group is aimed at all devices if Global (255) is used as the destination address. Here, the PGN is formed only from PDU format.

PDU format lies from 240-255: -

  • Then the message can only be broadcast (BAM).

  • PDU format and the Group Extension in the PDU specific field form the PGN of the transmitted parameter group.

  • The Group extension expands the number of possible broadcast Parameter Groups that the identifier can represent.

  • Source Address: These contain the address of the device transmitting the message. The address is a specific label assigned to access a given device on the network uniquely. For any given network, every address must be unique. There are a total of 254 different addresses available. No two different devices (ECUs) can use the same address.

PGN and SPNs in SAE J1939

Parameter Group Number (PGN) is the unique frame identifier within the J1939 standard, used to refer to the value of the Reserve bit, Data Page, PDU Format, and PDU Specific fields combined into a single 18-bit value. Parameter Groups contains the information on parameter assignments within each message’s 8-byte CAN data field, repetition rate, and priority.

Parameter Group Numbers can be classified into two types: -

1. Global Parameter Group Numbers

Such PGNs identify parameter groups that are broadcast (sent to all). Here, the PDU Format is >= 240, and the PDU Specific field is a Group Extension.

2. Specific Parameter Group Numbers

These are for parameter groups that are sent peer-to-peer (to a particular device). If the PDU Format is <=239, and the PDU Specific field is set to 0.

No matter the type for both the PGNs, the PDU Format, PDU Specific, Data Page and Extended Data Page are used to identify the corresponding Parameter Group.

SAE J1939 PGN

Suspect Parameter Number (SPN) is a number assigned by the SAE to a specific parameter within a parameter group. These serve as the identifier for the CAN signals in the data bytes. The SPNs are also defined for internal protocol information. SPNs are used for diagnostic purposes to report and identify the abnormal operation of a Controller Application (CA).

The SPN is a 19-bit number and has a range from 0 to 524287.  A range from 520192 to 524287 is reserved for proprietary parameters. Except for alphanumeric data, the SPN is always interpreted from LSB to MSB (right to the left). An SPN may be present in multiple PGNs. PGNs group SPNs, and it describes the parameter in detail by providing the following information:

  • Data Length in bytes

  • Scale

  • Data Type

  • Unit

  • Resolution

  • Offset

  • Range

  • Reference Tag (Label)

Parameter Groups (PG) contain the SPNs that share common characteristics, and they are transmitted throughout the network using that Parameter Group Number (PGN).

Transport Protocol in SAE J1939

As specified before, PGNs with up to 1785 bytes are supported via the J1939 transport protocol. But, to send a message above 8-byte, the bigger messages are needed to be broken down into smaller packets at the transmitting end. Each packet is sent with a CAN message (also called multi-packet transmission) and recombined at the receiving end. The rules that define how the message is to be broken, transmitted and reconstructed are known as the Transport Protocol of SAE J1939.

There a two Transport protocol types defined in SAE J1939:

1. Broadcast Announce Message (BAM):

  • One-to-many kind of communication.

  • Uses Global destination address.

  • The message is transmitted to all the nodes. Here the transmitter is responsible for managing the entire flow of data across the network.

  • The receiver in any way can not interfere in this communication. Even in the event of not receiving any data packet, the receiver cannot signify it.

  • It is the sole responsibility of the transmitter to maintain a specific time gap between the transmission of two packets (ranging from 50-200ms). Hence leading to slow communication across the network, but it also allows the slower nodes to keep pace with communication.

2. Connection Mode (CM):

  • Peer-to- peer connection.

  • Involves specific devices where the transmitting end sends a CM message with a Control byte indicating Request to Send (RTS), including the number of bytes, the number of packets, and the PGN whose data will be transported.

  • The receiver responds with a CM message with a Clear to Send (CTS) in the Control byte, including the number of packets the receiver expects next and the packet number to start with.

  • Here, the receiver is responsible for controlling the data flow and the flow of the individual packets. But both the transmitter and receiver can terminate the communication at any point in time.

  • The transmission is not time-bound, and each node functions at its maximum speed. Hence, making this mode faster.

Diagnostics Trouble Code in SAE J1939

In the J1939 standard, there exist special diagnostics trouble codes. Every failure in the ECU(s) is recorded as a diagnostics trouble code. These recognise and record any faulty properties of any SPN behaving abnormally, and failure indicators are used to narrow down the cause behind a specific error.

DTC in J1939

SPN: - Specifies the SPN with fault (0-524,287).

FMI: - Failure Mode indicator specifies the type/nature of the error (0-31).

OC: - Occurrence Counter specifies the number of occurrences of the given fault (0-127).

CM: - Specifies the conversion method by defining the byte alignment in DTC (0-1).

For example: -

SPN= 829 >> Left fuel level sensor.

FMI=3 >>Voltage above normal.

OC=2 >>The error occurred two times.

J1939 Digital Annex:

If you are this far on this article, ‘CAN DBC’ might sound familiar. It makes sense that just like CAN, J1939 also might have its own database files. But SAE does not maintain or defines any DBC for J1939. Instead, an excel file named J1939 Digital Annex is maintained and sold by SAE to communicate all the technical information needed to create a DBC file for J1939. With the help of J1939DA, one can create their DBC files, depending on the type of information required to be understood by the manufacturer’s product. Also, several applications from various manufactures are available that read the DBC file, such as ‘DiaLog’, from Influx. The Rebel and ReXgen series of CANbus data loggers from Influx support logging of J1939 data. ReXgen can log data based on J1939 filters (SA, DA, PGN), and the trigger can be set up based on DM1 counters.

The Digital Annex for J1939 can be purchased from SAE. For so, please visit

https://www.sae.org/search/?qt=j1939da

Other useful links: -

https://www.kvaser.com/about-can/higher-layer-protocols/j1939-introduction/

To know more about Influx Technology J1939 compatible data loggers, Click here.