Introduction to RP1210A (RP1210B)
The RP1210 is a recommended practice written by the Technology and Maintenance Council (TMC). RP1210 is used for reprogramming and analyzing of emission related (mainly) Electronic Control Units (ECUs) in heavy duty vehicles. The purpose of RP1210 was to create a standardized API for communication between vehicle ECUs and a PC using a flavor of Microsoft Windows as operating system. This standard makes it possible for third party companies to develop and sell the hardware interface needed between the PC and the ECU which is connected to a onboard communication bus (i.e. CAN).
Figure 1 shows the connection principles. RP1210 API includes standard functions and routines for communication (i.e. connect, write and read). The hardware device must conform to the standard functions and be able to communicate with the ECU independent of the data communication protocol that it is connected to. A RP1210A hardware device should include the following protocols; J1708/J1587, CAN, J1939 and J1850. The latest version RP1210B makes support for J1850 optional.
The application that uses the RP1210 DLL should give the user the possibility to choose which hardware tool to use. Sometimes the application automatically searches for a tool connected to the PC. When a hardware tool has been chosen (or found) the specific DLL for this hardware has to be loaded.
Messages from the vehicle data bus are buffered in the hardware tool. This requires memory space in the hardware tool. This also requires time stamps associated with every single message so that the software application can distinguish which message that was sent first. The timestamp should be 4 bytes long and be in Motorola format (most significant byte first).
The software application must be able to initialize and reset the hardware tool parameters and pins. There are API functions for this purpose.
The API must include functions for message filtering. The filtering should be done by the hardware tool. This way no unnecessary messages have to be sent all the way thru to the PC.
Initialization of the hardware tool, i.e. setting of baud rate and pins for programming must be controllable from the software application.
The RP1210 API consists of a number of standardized functions for controlling the communication between the PC software application and the hardware connected to ECUs on the vehicle bus. To be able to connect the PC to the vehicle bus some kind of hardware is required which includes a CAN transceiver. J1587/1708 requires a different hardware transceiver.
The hardware tool provides the physical means to transmit and receive messages on different bus types, but it has to be initialized with the right parameters for each protocol. To control the hardware functions from the PC an API is required. The API must be implemented in both PC application and in the microprocessor on the hardware tool; in other words, the hardware tool must understand the commands sent from the PC application and return the requested information, or in some cases just a receipt of the command. There are several standard commands described in the RP1210 document; see table 1.
|Function Name||Brief Description|
|RP1210_ClientConnect||Establishes a logical client connection with the API DLL.|
|RP1210_ClientDisconnect||Disconnects the logical client application from the API DLL.|
|RP1210_SendCommand||Sends a command to the API DLL for things like filtering, etc.|
|RP1210_SendMessage||Sends a message to the API DLL.|
|RP1210_ReadMessage||Reads a message from the API DLL.|
|RP1210_ReadVersion||Reads version information from the API, about the API.|
|RP1210_ReadDetailedVersion||Newer more comprehensive version information command. This command is now preferred over the RP1210_ReadVersion call.|
|RP1210_GetErrorMsg||Translates an RP1210 error code into a textual description of the error.|
|RP1210_GetHardwareStatus||Returns information state of the connection and data link.|
Table 1: Description of API functions
The reprogramming of an ECU is done by sending certain ECU specific messages. These messages are sent like any other message with the RP1210_SendMessage command.
The command RP1210_SendCommand includes several functions, e.g.
- Resetting of the hardware device.
- Setting and resetting of filters.
- Initialization of broadcast messages.
- Echoing of messages.
The filter function in RP1210 is inclusive, which means that the application must designate exactly which MID, PGN or CAN-ID that should pass. A new feature in RP1210B is an exclusive filter function. This filter allows the application to let all messages pass except the messages including MID, PGN or CAN-ID selected not to pass. J1708 PIDs can not be filtered in the hardware; this must be done in the software application.
Echoing of messages means that messages sent by the application through the hardware tool and onto the vehicle bus, are returned to the receive message buffer in the hardware tool. The transmitted messages are then returned to the application when it reads the received message buffer. Initially the echoing of messages is turned off.
RP1210 API DLL
Each manufacturer of a hardware tool has a DLL file with a unique name. In this way it is possible for the software application on the PC to select which hardware tool to connect to.
The API DLL includes functions that are compliant to the functions in the PC application.
The data communication between PC and hardware tool is not specified in the RP1210 document. This gives the manufacturer of the hardware tool the possibility of choosing the communication protocol i.e. RS-232, USB, or maybe some wireless protocol. Each protocol has it own API for communicating with the PC. The RP1210 API DLL has to provide a link between the RP1210 API functions and protocol specific API for sending and receiving messages. This obviously has to be done by the manufacturer of hardware tool. This makes it possible for any PC application to use the standard API functions without considering which protocol that is being used between the hardware tool and the PC.