The following is an excerpt from A Comprehensible Guide To J1939 by Wilfried Voss.
According to SAE J1939/81, network management procedures are used to “collectively manage the network”.
While other higher layer protocols based on CAN Bus do not support dynamic node address assignments per default, the SAE J1939 standard provides yet another ingeniously designed feature to uniquely identify ECUs and their primary function.
The CAN standard in itself does not support node (ECU) addresses, only message IDs, where one node may manage multiple messages. However, the message ID must be hard-coded in the application program.
The SAE J1939 network management messages have the same characteristics as all other J1939 messages. These messages are:
- In case no address has been claimed as of yet the source address could be set to 254.
- The commanded address, since it is longer than 8 bytes, is sent using the Transport Protocol as described in chapter Transport Protocol.
Request For Address Claimed
The Request for Address Claimed message (PGN 59904) is identical to the Request message type as described in SAE J1939/21 and chapter Parameter Group Numbers in this book.
The Request for Address Claimed message is used to request the sending of an Address Claimed message from either a particular node in the network or from all nodes (use of global destination address = 255). The Address Claimed message (as described in the following chapter) will provide the requested information, i.e. address and NAME of the responding node(s).
The purpose of sending such a request may be for several reasons, for instance:
- A node is checking whether or not it can claim a certain address.
- A node is checking for the existence of another node (Controller Application) with a certain function.
The response to a Request for Address Claimed message can be multiple:
- Any addressed node that has already claimed an address will respond with an Address Claimed message.
- Any addressed node that was unable to claim an address will respond with a Cannot Claim Address message.
- Any addressed node that has not yet claimed an address should do so by responding with their own Address Claimed message where the source address is set to NULL (254).
- A node sending the Request for Address Claimed message should respond to its own request in case the global destination address (255) was used.
Address Claimed / Cannot Claim
The Address Claimed message is used either, as the name indicates, to claim a message or to respond to a Request for Address Claimed message.
The following rules apply:
- The Address Claimed message, for the purpose of claiming an address, should always be addressed to the global address (255).
- The Address Claimed message, for the purpose of claiming an address, should be sent during the initialization of the network or as soon as the node is connecting to a running network.
- As soon as a node has successfully claimed an address, it may begin with regular network activities, i.e. sending messages or responding to messages.
- If a node (Controller Application) receives an Address Claimed message it should first compare the claimed address with its own. If the addresses are identical, the node should compare its own NAME to the NAME of the claiming node. In case its own NAME has a higher priority (lower numeric value) it will then transmit an Address Claimed message containing its NAME and address. If its own NAME is of a lower priority the node, depending on its capabilities, should either send a Cannot Claim Address message or claim another address.
- In case a node loses its address through the previously described procedure and was also in the process of sending a Transport Protocol message (see chapter Transport Protocol Functions) it should cease the transmission immediately, however, without sending a Transport Protocol Abort message. The receiver of the Transport Protocol message will detect the interruption through the corresponding timeout process.
The Cannot Claim Address message has the same format as the Address Claimed message, but it uses the NULL address (254) as the source address.
The following rules apply for the Cannot Claim Address message:
- As the name implies, a node without arbitrary addressing capabilities will send a Cannot Claim Address message when it is unable to claim the preferred address.
- A node with arbitrary addressing capabilities will send a Cannot Claim Address message when no addresses are available in the network.
- If the Cannot Claim Address message is a response to a Request for Address Claimed message, the node should apply a “pseudo-random” delay of 0 to 153 ms should be applied before sending the response. This will help prevent the possibility of a bus error, which will occur when two nodes send the same message with identical message ID.
Note: SAE J1939/81 is concerned that the occurrence of such an error condition will consume “a large number of bit times on the bus”. However, the time for transmitting a CAN Bus message with a 29-Bit ID followed by an error frame will be well under 1 ms.
SAE J1939 ECU Simulator Board With USB Port
The jCOM.J1939.USB gateway board is a high-performance, low-latency vehicle network adapter for SAE J1939 applications. It allows any host device with a USB COM port to monitor SAE J1939 data traffic and communicate with the SAE J1939 vehicle network.
The board supports the full SAE J1939 protocol according to J1939/81 Network Management (Address Claiming) and J1939/21 Transport Protocol (TP). It is also supported by an extensive programming interface for Windows and Linux/Ubuntu applications, including full C/C++/C# source code for short time-to-market developments.
The strength of the board lies in the fact that the entire SAE J1939 protocol, including all timing requirements, is stored on-chip, thus taking the burden off the main system. The board uses a USB COM port to communicate with the main system, i.e. all data transfer is handled through a standard COM port access.
The communication protocol between the board and the main system is well documented and thus allows a porting to any computer system with a USB connection. Working source code libraries exist for Windows (C# under Visual Studio 2012/2013), Linux and its derivatives (C++ using Code::Blocks), and Raspberry Pi (C using the standard gcc compiler).
The following is an excerpt from A Comprehensible Guide To J1939 by Wilfried Voss. SAE J1939 is a very ingeniously designed protocol that takes a resourceful advantage of the CAN 29-Bit message identifier. Rather than relying on a myriad of protocol functions, SAE J1939 uses predefined parameter tables, which keeps the actual protocol on a comprehensible level. However, these parameter tables [...]
The following is an excerpt from A Comprehensible Guide To J1939 by Wilfried Voss. The main document describing the J1939 message format is SAE J1939/21 – Data Link Layer. J1939/21 defines the use of the CAN data frame (29-bit identifier, Parameter Group Numbers – PGN, etc.) and the transport protocol functions, i.e. a definition of how messages longer than the standard [...]
The following is an excerpt from A Comprehensible Guide To J1939 by Wilfried Voss. SAE J1939 is a higher-layer protocol based on Controller Area Network (CAN). It provides serial data communications between microprocessor systems (also called Electronic Control Units - ECU) in any kind of heavy-duty vehicles.Everything that has to do with CAN is based on maximum reliability with the [...]
This post is part of a series about SAE J1939 ECU Programming & Vehicle Bus Simulation with Arduino. Proving the capability of the most basic task of sending and receiving regular 8-byte (CAN) messages must be seen as an unnecessary test, since that had already taken place in previous chapters. Things change, however, with the transmission and reception of J1939 [...]
This post is part of a series about SAE J1939 ECU Programming & Vehicle Bus Simulation with Arduino. In a previous project (see chapter SAE J1939 Simulation Example) I demonstrated the simulation of SAE J1939 data traffic. However, the messages in that example were transmitted within a certain frequency. In the following, we will transmit messages according to user input. As before, [...]
This post is part of a series about SAE J1939 ECU Programming & Vehicle Bus Simulation with Arduino. In this following project, we will discover yet another SAE J1939 protocol feature, namely the Request Message (as defined in the SAE J1939/21 standard). As with the previous project, we will need two J1939 nodes, and therefore will need two projects, one to [...]
This post is part of a series about SAE J1939 ECU Programming & Vehicle Bus Simulation with Arduino. Parameters groups are, for instance, engine temperature, which includes coolant temperature, fuel temperature, oil temperature, etc. Parameter Groups and their numbers (PGN) are listed in SAE J1939 (roughly 300 pages) and defined in SAE J1939/71, a document containing roughly [...]
This post is part of a series about SAE J1939 ECU Programming & Vehicle Bus Simulation with Arduino. A Suspect Parameter Number (SPN) is a number assigned by the SAE to a specific parameter within a parameter group. It describes the parameter in detail by providing the following information: Data Length in bytes Data [...]
This post is part of a series about SAE J1939 ECU Programming & Vehicle Bus Simulation with Arduino. SAE J1939 is a very ingeniously designed protocol that takes a resourceful advantage of the CAN Bus 29-Bit message identifier. Rather than relying on a myriad of protocol functions, SAE J1939 uses predefined parameter tables, which keeps the actual protocol on a [...]