SAE J2534 Pass-Thru API


Connects to the OBDII J1962 DLC and supports the following protocols.
1 CAN2 Single Wire
2 J1850PWM+ , J1850VPW
3 CAN2+
6 CAN+ (CAN-C only), SCI A Engine, 5v-20v out
7 ISO-9141 K-line, SCI A Engine, SCI A Trans, SCI B Engine
9 SCI B Trans, 5v-20v out or short-to-ground
10 J1850PWM-
11 CAN2- 5v-20v out
12 SCI B Engine 5v-20v out or short-to-ground
14 CAN- (CAN-C only), SCI A Trans 5v-20v out
15 ISO L Line, SCI B Trans, Short-to-ground

The PassThru device manufacturer supplies the hardware appliance and cable that connects to and communicates with the vehicle network.
The physical interface to the vehicle network is the SAE J1962 connector, which supports the various vehicle serial data protocols.
The following network layer protocols are supported:
ISO 9141
ISO 14230-4(KWP2000, Keyword Protocol)
SAE J1850 41.6 KBPS PWM(Pulse Width Modulation)
SAE J1850 10.4 KBPS VPW(Variable Pulse Width)
CAN(Controller Area Network, ISO 11898)
ISO 15765-4(CAN)
SAE J2610 DaimlerChrysler SCI(Serial Communications Interface)
J2534-1: Recommended Practice for Pass-Thru Vehicle Programming Last published version 12/2004
J2534-2: Optional Pass-Thru Features Last published version 04/2010
J2534-3: Conformance Test Cases for an SAE J2534-1 Device No published document
SAE J2534-1
defines an Application Program Interface (API) that can be used by Vehicle Manufacturers for reprogramming emission related modules.
This interface also includes some capabilities that may not be required for reprogramming,
but allows the interface to be used for other purposes without placing a significant burden on the interface manufacturers.
SAE J2534-2
defines optional features that takes advantage of the J2534-1 framework.
It allows the interface (J2534) to be used for other purposes and includes features that are above and beyond emission related reprogramming needs.
Many OEM’s wanted a standard for reprogramming other modules not “Emission Related”.
Those instructions were added into -2. It also expands the scope of what a J2534 device can do. (ie: Diagnostics)
SAE J2534-3
defines a set of conformance test cases, which can be used to check an interface’s compliance with SAE J2534-1 Conformance test cases are planned for J2534-2 features
also Some preliminary work has been done on the J2534-1 conformance test cases.
No work has been initiated for the J2534-2 conformance test cases.
There is no published standard yet.
J2534 framework includes application interfaces for the following functionality:
Network Initialization
Basic Send and Receive
Periodic Transmission Capability
Message Filters
Generic IO Control
Protocol Specific IO Control
Programming Voltage Supply
Other Utility Functions
Protocols Supported by a fully compliant SAE J2534-1 Device
J1850 VPW (GM Class2, Chrysler OBD)
J1850 PWM (Ford SCP)
High Speed CAN ISO 15765-4 (Diag. On CAN)
ISO 14230 (KWP)
ISO 9141-2
Chrysler SCI
Additional Protocols Currently Supported by the SAE J2534-2 Specifications
SAE J1939
SAE J1708
Single Wire CAN
GM UART
UART Echo Byte
Ford MS-CAN
Honda Diag-H
TP 2.0
Fault Tolerant CAN
6.5.1 ISO 9141
The following specifications clarify and, if in conflict with ISO 9141, override any related specifications in ISO 9141:
a. The maximum sink current to be supported by the interface is 100 mA.
b. The range for all tests performed relative to ISO 7637-1 is –1.0 to +40.0 V.
c. The default bus idle period before the interface shall transmit an address, shall be 300 ms.
d. Support following baud rate with ±0.5% tolerance: 10400.
e. Support following baud rate with ±1% tolerance: 10000.
f. Support following baud rates with ±2% tolerance: 4800, 9600, 9615, 9800, 10870, 11905, 12500, 13158, 13889, 14706, 15625, and 19200.
g. Support other baud rates if the interface is capable of supporting the requested value within ±2%.
h. The baud rate shall be set by the application, not determined by the SAE J2534 interface. The interface is not required to support baud rate detection based on the synchronization byte.
i. Support odd and even parity in addition to the default of no parity, with seven or eight data bits. Always one start bit and one stop bit.
j. Support for timer values that are less than or greater than those specified in ISO 9141 (see Figure 30 in Section 7.3.2).
k. Support ability to disable automatic ISO 9141-2 / ISO 14230 checksum verification by the interface to allow vehicle manufacturer specific error detection.
l. If the ISO 9141 checksum is verified by the interface, and the checksum is incorrect, the message will be discarded.
m. Support both ISO 9141 5-baud initialization and ISO 14230 fast initialization.
n. Interface shall not adjust timer parameters based on keyword values.
6.5.2 ISO 14230-4 (KWP2000)
The ISO 14230 protocol has the same specifications as the ISO 9141 protocol as outlined in the previous section.
In addition, the following specifications clarify and, if in conflict with ISO 14230, override any related specifications in ISO 14230:
a. The pass-thru interface will not automatically handle tester present messages. The application needs to handle tester present messages when required.
b. The pass-thru interface will not perform any special handling for the $78 response code.
Any message received with a $78 response code will be passed from the interface to the application.
The application is required to handle any special timing requirements based on receipt of this response code, including stopping any periodic messages.
6.5.3 SAE J1850 41.6 KBPS PWM (PULSE WIDTH MODULATION)
The following additional features of SAE J1850 must be supported by the pass-thru device:
a. Capable of 41.6 kbps and high speed mode of 83.3 kbps.
b. Recommend Ford approved SAE J1850PWM (SCP) physical layer
6.5.4 SAE J1850 10.4 KBPS VPW (VARIABLE PULSE WIDTH)
The following additional features of SAE J1850 must be supported by the pass-thru device:
a. Capable of 10.4 kbps and high speed mode of 41.6 kbps
b. 4128 byte block transfer
c. Return to normal speed after a break indication
6.5.5 CAN
The following features of ISO 11898 (CAN) must be supported by the pass-thru device:
a. 125, 250, and 500 kbps
b. 11 and 29 bit identifiers
c. Support for 80% ± 2% and 68.5% ± 2% bit sample point
d. Allow raw CAN messages. This protocol can be used to handle any custom CAN messaging protocol, including custom flow control mechanisms.
6.5.6 ISO 15765-4 (CAN)
The following features of ISO 15765-4 must be supported by the pass-thru device:
a. 125, 250, and 500 kbps
b. 11 and 29 bit identifiers
c. Support for 80% ± 2% bit sample point
d. To maintain acceptable programming times, the transport layer flow control function, as defined in ISO 15765-2, must be incorporated in the pass-thru device (see Appendix A).
If the application does not use the ISO 15765-2 transport layer flow control functionality, the CAN protocol will allow for any custom transport layer.
e. Receive a multi-frame message with an ISO15765_BS of 0 and an ISO15765_STMIN of 0, as defined in ISO 15765-2.
f. No single frame or multi-frame messages can be received without matching a flow control filter.
No multi-frame messages can be transmitted without matching a flow control filter.
g. Periodic messages will not be suspended during transmission or reception of a multi-frame segmented message.
6.5.7 SAE J2610 DAIMLERCHRYSLER SCI
Reference the SAE J2610 Information Report for a description of the SCI protocol.
When in the half-duplex mode (when SCI_MODE of TxFlags is set to {1} Half-Duplex), every data byte sent is expected to be "echoed" by the controller.
The next data byte shall not be sent until the echo byte has been received and verified.
If the echoed byte received doesn't match the transmitted byte, or if after a period of T1 no response was received, the transmission will be terminated.
Matching echoed bytes will not be placed in the receive message queue.
What is an API?
An API (Application Programming Interface) is a 'rendezvous point' between two pieces of software.
For example, any Windows application (such as MS Word and Photoshop) can print to any printer.
How is this possible? The application and the printer driver communicate via an API. Even though each printer has different hardware,
all printer drivers 'look the same' to Windows applications.
You are free pick any printer based on your preferences (color, size, durability, cost, speed) without worrying about software incompatibilities.
In a similar vein, the J2534 API makes all "car communications" hardware look the same.
The Software
The EPA is forcing car manufacturers to release software that updates the firmware on their cars.
The application must run on Windows and use the J2534 API to talk to the car.
Anyone can buy this software, even individual car enthusiasts.
The software must be sold 'for a reasonable price', which will probably be a few hundred dollars.
The Hardware
A J2534 device plugs into a cars' OBD connector on one side, and a computer on the other side.
These devices are not made by car manufacturers, but by any company that sees an opportunity.
Under the hood, the device must speak a myriad of different vehicle protocols (ISO9141, J1850VPW/PWM, CAN, etc.)
used by the different manufacturers. Each protocol has different voltage and timing requirements,
so this is no trivial task. Fortunately, each device comes with a software driver that implements the J2534 API.
Since the driver invisibly handles communication to the device, application software
writers don't have to worry about the connection details or low-level car protocols.
http://www.drewtech.com/support/J2534/errorcodes.html
All the error codes returned by J2534 API are listed below:
| Value | Name | Description |
|---|---|---|
| 0x00 | STATUS_NOERROR | Function completed successfully. |
| 0x01 | ERR_NOT_SUPPORTED | Function option is not supported. |
| 0x02 | ERR_INVALID_CHANNEL_ID | Channel Identifier or handle is not recognized. |
| 0x03 | ERR_INVALID_PROTOCOL_ID | Protocol Identifier is not recognized. |
| 0x04 | ERR_NULL_PARAMETER | NULL pointer presented as a function parameter, NULL is an invalid address. |
| 0x05 | ERR_INVALID_IOCTL_VALUE | Ioctl GET_CONFIG/SET_CONFIG parameter value is not recognized. |
| 0x06 | ERR_INVALID_FLAGS | Flags bit field(s) contain(s) an invalid value. |
| 0x07 | ERR_FAILED | Unspecified error, use PassThruGetLastError for obtaining error text string. |
| 0x08 | ERR_DEVICE_NOT_CONNECTED | PassThru device is not connected to the PC. |
| 0x09 | ERR_TIMEOUT | Timeout violation. PassThru device is unable to read specified number of messages from the vehicle network. The actual number of messages returned is in NumMsgs. |
| 0x0A | ERR_INVALID_MSG | Message contained a min/max length, ExtraData support or J1850PWM specific source address conflict violation. |
| 0x0B | ERR_INVALID_TIME_INTERVAL | The time interval value is outside the specified range. |
| 0x0C | ERR_EXCEEDED_LIMIT | The limit (ten) of filter/periodic messages has been exceeded for the protocol associated the communications channel. |
| 0x0D | ERR_INVALID_MSG_ID | The message identifier or handle is not recognized. |
| 0x0E | ERR_DEVICE_IN_USE | The specified PassThru device is already in use. |
| 0x0F | ERR_INVALID_IOCTL_ID | Ioctl identifier is not recognized. |
| 0x10 | ERR_BUFFER_EMPTY | PassThru device could not read any messages from the vehicle network. |
| 0x11 | ERR_BUFFER_FULL | PassThru device could not queue any more transmit messages destined for the vehicle network. |
| 0x12 | ERR_BUFFER_OVERFLOW | PassThru device experienced a buffer overflow and receive messages were lost. |
| 0x13 | ERR_PIN_INVALID | Unknown pin number specified for the J1962 connector, or resource is already in use. |
| 0x14 | ERR_CHANNEL_IN_USE | An existing communications channel is currently using the specified network protocol. |
| 0x15 | ERR_MSG_PROTOCOL_ID | The specified protocol type within the message structure is different from the protocol associated with the communications channel when it was opened. |
| 0x16 | ERR_INVALID_FILTER_ID | Filter identifier is not recognized. |
| 0x17 | ERR_NO_FLOW_CONTROL | No ISO15765 flow control filter is set, or no filter matches the header of an outgoing message. |
| 0x18 | ERR_NOT_UNIQUE | An existing filter already matches this header or node identifier. |
| 0x19 | ERR_INVALID_BAUDRATE | Unable to honor requested Baud rate within required tolerances. |
| 0x1A | ERR_INVALID_DEVICE_ID | PassThru device identifier is not recognized. |
API Functions
PassThruOpen
PassThruClose
PassThruConnect
PassThruDisconnect
PassThruReadMsgs
PassThruWriteMsgs
PassThruStartPeriodicMsg
PassThruStopPeriodicMsg
PassThruStartMsgFilter
PassThruStopMsgFilter
PassThruSetProgrammingVoltage
PassThruReadVersion
PassThruGetLasError
PassThruIoctl
PassThruScanForDevices
PassThruGetNextDevice
PassThruGetDeviceContent
PassThruLogicalConnect
PassThruLogicalDisconnect
PassThruQueueMsgs
IOCTLS
GET_CONFIG
SET_CONFIG
READ_VBATT
FIVE_BAUD_INIT
FAST_INIT
CLEAR_TX_BUFFER
CLEAR_RX_BUFFER
CLEAR_PERIODIC_MSGS
CLEAR_MSG_FILTERS
CLEAR_FUNCT_MSG_LOOKUP_TABLE
DELETE_FROM_FUNCT_MSG_LOOKUP_TABLE
READ_PROG_VOLTAGE
http://www.drewtech.com/support/J2534/index.html
The following pages explain DrewTech's implementation, and should be useful to end-users who want to program with our DLL:
| Category | Name | Description |
|---|---|---|
| Setup | PassThruOpen | Initialize and connect to a CarDAQ |
| PassThruClose | Disconnect from a CarDAQ | |
| PassThruConnect | Connect to a vehicle network | |
| PassThruDisconnect | Disconnect from vehicle network | |
| PassThruIoctl | Fast init sequence (ISO 9141) | |
| PassThruIoctl | Five baud init sequence (ISO 9141) | |
| PassThruIoctl | Report configuration parameter | |
| PassThruIoctl | Set configuration parameter | |
| PassThruIoctl | Add functional address (J1850PWM) | |
| PassThruIoctl | Delete functional address (J1850PWM) | |
| PassThruIoctl | Clear functional address table (J1850PWM) | |
| Status | PassThruReadVersion | Report version information |
| PassThruGetLastError | Describe most recent error | |
| PassThruIoctl | Read vehicle battery voltage | |
| Reading | PassThruReadMsgs | Receive network message(s) |
| PassThruStartMsgFilter | Apply a network message filter | |
| PassThruStopMsgFilter | Stop a network message filter | |
| PassThruIoctl | Halt all network message filters | |
| PassThruIoctl | Clear receive buffer | |
| Writing | PassThruWriteMsgs | Transmit network message(s) |
| PassThruStartPeriodicMsg | Continuously transmit message(s) | |
| PassThruStopPeriodicMsg | Stop transmitting a message continuously | |
| PassThruIoctl | Halt all continuous messages | |
| PassThruIoctl | Clear transmit queue | |
| Reflashing | PassThruSetProgrammingVoltage | Apply voltage on J1962 pin |
| PassThruIoctl | Report programming voltage | |
| Analog | PassThruIoctl | Read most recent analog sample |
| PassThruIoctl | Read stored analog sample(s) |
https://github.com/hackingvolvo/SardineCAN-Win32/tree/master/Sardine
https://github.com/hackingvolvo/SardineCAN-Win32/blob/master/Sardine/j2534_v0404.h









8. Message Structure
The following message structure will be used for all messages (Transmit, Receive, Filters, and Periodics)
and indications. The total message size (in bytes) is the DataSize, and includes header bytes, ID bytes,
and data bytes. For consistency, all interfaces should detect only the errors listed for each protocol in the
following sections when returning ERR_INVALID_MSG.
8.1 C / C++ Definition
typedef struct {
unsigned long ProtocolID;
unsigned long RxStatus;
unsigned long TxFlags;
unsigned long Timestamp;
unsigned long DataSize;
unsigned long ExtraDataIndex;
unsigned char Data[];
} PASSTHRU_MSG;








SAE J2534-2
SAE J2534-1 defines a standard vehicle network interface that can be used to reprogram emissionrelated control modules.
However, there is a need to support vehicles prior to the 2004 model year as well as non-emission related control modules.
The SAE J2534-2 document meets these needs by detailing extensions to an SAE J2534-1 interface.
Together, these extensions provide the framework for a common interface to protect the software investment of the Vehicle OEMs and Scan Tool manufacturers.
Only the optional features will be described by this document. Unless otherwise noted it is expected that these features are added
to a fully compliant interface adhering to the December 2004 publication of SAE J2534-1.
Only the optional features will be described by this document. Unless otherwise noted it is expected that these features
are added to a fully compliant interface adhering to the December 2004 publication of SAE J2534-1.
Extending the protocols supported by SAE J2534-1 this document adds two new types of ProtocolIDs.
1. ProtocolIDs with the suffix ‘_PS’ for connecting to a vehicle, via the SAE J1962 connector using the technique outlined in the section titled ‘SAE J1962 Pin Selection’.
2. Generic ProtocolIDs, with the suffixes ‘_CH1’ through ‘_CH128’ for protocols that terminate at a vendor specific connector on the device. See the section titled ‘Access to Additional Channels’.
5. SAE J1962 Pin Selection
5.1 Scope of the SAE J1962 Pin Selection Optional Feature
This section identifies the pin selection mechanism for ProtocolIDs that have the ‘_PS’ suffix.
The API extensions detailed here describe the method of specifying the SAE J1962 pin(s) to which the selected protocol should be connected.
While the API allows for all combinations of protocol / pin assignments, the actual combinations implemented are vendor specific.
5.2 Pass-Thru System Requirements
5.2.1 PIN USAGE
The set of pins that can be switched is dependant on the set of optional protocols supported by the interface.
A new SET_CONFIG parameter is defined for the application to specify the pins to be switched.
5.3 Win32 Application Programming Interface
5.3.1 API FUNCTIONS – OVERVIEW
The new ProtocolIDs with ‘_PS’ suffix indicates that the protocol physical layer is not connected to the SAE J1962 pins on PassThruConnect.
A new Ioctl configuration parameter is also added, that allows connection of a physical layer to specific SAE J1962 pins.
For support of SAE J2534-1 protocols on different pins than those defined in SAE J2534-1, new ProtocolIDs are assigned to enable the pin-switching feature as defined in Figure 1:

As an example, in order to utilize a CAN channel connected to Pins 3 and 11 (often used for Medium Speed CAN network), the new CAN_PS ProtocolID is used in PassThruOpen.
Note that the SAE J2610 (DaimlerChrysler SCI) protocols are consolidated into a single new ProtocolID, J2610_PS.
However the SAE J2534-1 SCI protocols shall continue to be supported as defined in SAE J2534-1.
New SAE J2534-2 optional feature protocols use the ProtocolIDs defined in Figure 2:

SAE J2534 Pass-Thru API的更多相关文章
- SAE J2534介绍
概要 J2534是一种针对与射频相关的ECU进行闪存编程的概念,而不用考虑ECU使用的通信协议.其目的是所有类型的ECU都应当只需一个工具(硬件设备),通常被称为通过式设备.J2534设备和ECU之间 ...
- J2534 Pass-Thru Vehicle Programming ( SAE J1962 connector and Protocol )
SAE J1962—Diagnostic Connector SAE J1850—Class B Data Communications Network Interface SAE J1939—Tru ...
- 【转】最佳Restful API 实践
原文转自:https://bourgeois.me/rest/ REST APIs are a very common topic nowaday; they are part of almost e ...
- RequireJS API
可以找到许多的解读,但是原文总是最重要的,也是最正宗的说明,直接访问 RequireJS 有时不太方便,这里将 RequireJS 2.0 API 的原文转载到博客园,方便查看. This is th ...
- Harbor api 操作
harbor 的版本为 1.5.2 为 Harbor 配置 swagger 官网参考: https://github.com/goharbor/harbor/blob/v1.5.2/docs/conf ...
- 使用CloudSight API进行图像识别的Python脚本
# -*- coding: utf-8 -*- # @Time : 2018/03/20 17:02 # @Author : cxa # @File : sss.py # @Software: PyC ...
- Flask 教程 第二十三章:应用程序编程接口(API)
本文翻译自The Flask Mega-Tutorial Part XXIII: Application Programming Interfaces (APIs) 我为此应用程序构建的所有功能都只适 ...
- Appium之常用API
Appium常用API解析 1.current_activity:获取当前页面的activity名,比如com.taobao.tao.TBMainActivity 或 com.taobao.brows ...
- 关于Vector CANoe的讨论
默认排序 踩猫尾巴 汽车电子攻城狮 27 人赞同了该回答 好像是很久以前的问题啊,为什么会现在收到邀请. 我觉得 @lijuqqkiko 介绍的足够啦. 我再额外发散一点吧. 目前在CAN总线测试和 ...
随机推荐
- K2 Blackpearl开发技术要点(Part2)
转:http://www.cnblogs.com/dannyli/archive/2012/09/14/2685282.html K2 Blackpearl开发技术要点(Part2)
- PHP中设置、使用、删除Cookie方法
1.设置Cookie PHP用SetCookie函数来设置Cookie.必须注意的一点是:Cookie是HTTP协议头的一部分,用于浏览器和服务器之间传递信息,所以必须在任何属于HTML文件本身的内容 ...
- zz github配置
First : 安装:ubuntu 下,终端输入命令: sudo apt-get install git-core git-gui git-doc Next : 设置SSH Key 检查是否已经有SS ...
- HTML5中DOM元素的querySelector/querySelectorAll的工作机制
在HTML5中,提供了强大的DOM元素选择API querySelector/querySelectorAll,允许使用JavaScript代码来完成类似CSS选择器的DOM元素选择功能.通常情况下, ...
- python27+django数据库配置常见问题
mysql缺乏模块,需要安装,建议去http://sourceforge.net/projects/mysql-python/files/mysql-python/下源码编译,或者安装msi文件htt ...
- javascript针对DOM的应用
所谓针对DOM的应用.也就我这里只教大家用javascript操作页面中dom元素做交互.我相信可能大部分人来这里学javascript主要还是想用这个结合页面中的DOM元素做一些实际有用的交互效果. ...
- ipv4头部分析,读书笔记3
ip头部最长是60字节,前面的20字节是固定的,选项可加上40字节 4位版本号--- 对于ipv4来说呢,就是4 4位头部长度 --- 表示 有多小个32bit(4字节),4位最大表示数是15啦,也 ...
- Java学习日志-01-Hello World
1.安装JDK1.7 2.安装eclipse 3.eclipse上写第一个java程序-hello world 先建工程,再建包,养成良好的习惯,然后新建类 若不先建立包,可能会提示"The ...
- Codeforces Educational Codeforces Round 15 C. Cellular Network
C. Cellular Network time limit per test 3 seconds memory limit per test 256 megabytes input standard ...
- 第二百一十天 how can I 坚持
Node.js 服务器端JavaScript,单进程. 该如何学习啊,貌似学什么都学不深入. 纠结死了. 睡觉.