SAE J1939 Programming with Arduino - Device NAME
This post is part of a series about SAE J1939 ECU Programming & Vehicle Bus Simulation with Arduino.
Each ECU (Electronic Control Unit) that actively participates in SAE J1939 communication (i.e. sending) requires a unique name, which is composed of a stream of 64 bits.
Within the standard the device name is defined as NAME.
It contains information that identifies and instantiates the device and describes the origin and function of the device.
By means of the device name, an ECU can be identified uniquely worldwide and be described as a unique ECU.
In addition, the device name is used to prioritize the ECU during dynamic address assignment
The SAE J1939 Standard defines a 64-Bit NAME, as shown in the following image, to uniquely identify an ECU in the network.
As indicated in the above image, some parameters and are assigned by the SAE, the rest is set by the manufacturer/developer of the application.
- Arbitrary Address Capable – Indicates whether or not the ECU/CA can negotiate an address (1 = yes; 0 = no). Some ECUs can only support one address; others support an address range.
- Industry Group – These codes are associated with particular industries such as on-highway equipment, agricultural equipment, and more.
- Vehicle System Instance – Assigns a number to each instance on the Vehicle System (in case you connect several networks – e.g. connecting cars on a train).
- Vehicle System – Vehicle systems are associated with the Industry Group and they can be, for instance, “tractor” in the “Common” industry or “trailer” in the “On-Highway” industry group.
- Reserved – Always zero.
- Function – This code, in a range between 128 and 255, is assigned according to the Industry Group. A value between 0 and 127 is not associated with any other parameter.
- ECU Instance – A J1939 network may accommodate several ECUs of the same kind (i.e. same functionality). The Instance code separates them.
- Manufacturer Code – The 11-Bit Manufacturer Code is assigned by the SAE.
- Identity Number – This field is assigned by the manufacturer, similar to a serial number, i.e. the code must be uniquely assigned to the unit.
For test and simulation purposes and with the assumption that the NAME is only used for the address claiming process, it is possible to set all required parameters to your liking. However, if you connect your application to a real-world SAE J1939 network, it is strongly advised to follow the official settings, which includes obtaining a manufacturer code.
For our Arduino projects, I have assigned the NAME fields in a way that they will not interfere when used within an existing vehicle network. This has been done by setting the Identity Number and Manufacturer Code to the maximum value, which will result in a more passive role during the address claim process. An ECU with a NAME of higher value is more likely to lose the competition with another node using the same address.
Note: All settings as shown are used for demonstration purposes only. In all consequence, you must follow the SAE's recommendations. Also, you alone (and not the author or publisher) are responsible for the final implementation and the results thereof.
#define NAME_IDENTITY_NUMBER 0xFFFFFF
#define NAME_MANUFACTURER_CODE 0xFFF
#define NAME_FUNCTION_INSTANCE 0x00
#define NAME_ECU_INSTANCE 0x00
#define NAME_FUNCTION 0xFF
#define NAME_RESERVED 0x00
#define NAME_VEHICLE_SYSTEM 0x7F
#define NAME_VEHICLE_SYSTEM_INSTANCE 0x00
#define NAME_INDUSTRY_GROUP 0x00
#define NAME_ARBITRARY_ADDRESS_CAPABLE 0x01
Note: These settings can be found in the ARD1939.h file of each project that involves the ARD1939 library.
SAE J1939 has become the accepted industry standard and the vehicle network technology of choice for off-highway machines in applications such as construction, material handling, and forestry machines. 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. The messages exchanged between these units can be data such as vehicle road speed, torque control message from the transmission to the engine, oil temperature, and many more.
A Comprehensible Guide to J1939 is the first work on J1939 besides the SAE J1939 standards collection. It provides profound information on the J1939 message format and network management combined with a high level of readability.