SAE J1939 network communication is developed for harsh use environments and can be used for the horizontally integrated vehicle industry. J1939 is also applicable for “off-road” or “on-road” vehicles, light, medium and heavy use, as well as it is appropriate for stationary applications that use components derived from vehicles.
The following figure shows an overview of the J1939 functionality:
The J1939 protocol stack uses well-defined CAN APIs (CANpie) to manage the CAN interface.
The message router is responsible for reading and writing CAN messages between the J1939 stack and the CAN bus. CANpie API and its concept of buffers are used to access the CAN interface on the different platforms available. CAN messages are received through specific buffers. Depending on the J1939 service, a specific CAN message buffer will be selected.
The J1939 manager covers initialization and stack control of the J1939 protocol. It also handles initialization of the CAN interface using a CANpie driver.
J1939 Parameter Group Number
A Parameter Group is a set of parameters that share the same context and the same transmission rate. The limit of a PG is not limited to the size of a CAN frame. Usually a J1939 Parameter Group has a minimum size of 8 bytes and a maximum of 1785 bytes.
The CAN identifier of a J1939 Protocol Data Unit (PDU) contains a Parameter Group Number (PGN), a data source address, priority, data page bit, extensive data page bit, and a destination address (this only for node-to-node communication configurations).
Messages larger than 8 bytes are too large to be transmitted in a single CAN data frame. Therefore, these messages must be separated by the sender into individual packages. These individual packets are sent one by one by the sender, and the specific receiver must re-group them in a single message in order to process them.
In J1939, there are 2 types of transport protocols.
Node to Node: The sender establishes communication with the receiver. By receiving the individual packets, the receiver has the ability to control the flow of each packet. Both the receiver and sender can abort communication, for example when an error occurs.
Global Communications: also called Broadcass Announce Message (BAM), the sender manages the flow of transmission by a sending messages to all network nodes. The receiver cannot intervene in the communication, it only receives the message and processes it as indicated; if it fails to receive a message, you will have to wait for another. To allow slow nodes to maintain communication on the network, the sender must maintain a minimum interval between messages (between 50-200ms).
The J1939 diagnostic application layer defines the J1939 messages necessary to perform diagnostic services and identify the diagnostic connector used in the vehicle diagnostic service tool interface. Diagnostic messages (DMs) include services of an active broadcasting newspaper message for continuous sending of error code, identifying status of operational diagnostic lamp, reading or cleaning diagnostic trouble codes, reading or writing memory of control modules , provide security functions, starting or turning off the broadcasting of diagnostic messages, ect.
J1939 Network Manager
The J1939 Network Manager handles source addressing and associations with certain functions and detection / reporting of network failures. Network administration also specifies the initialization of network communication, requirements for reaction to fast outages and a minimum of requirements for the ECUs involved in the network.
There are a number of J1939 services that need internal timers (BAM, message cycle time, ect). The values of the timers are multiples of 1 mS. The stack works internally with ticks.