0%

SAE-J1939

J1939主要需要了解ID组成,根据所需数据查找SPN,PGN然后组成ID; 了解帧格式 了解单,多帧数据请求

简介

J1939标准用于卡车、公共汽车和移动液压等重型车辆

J1939标准定义的大部分报文均旨在广播,使用CAN 2.0B协议中定义的29位标识符

协议结构

J1939物理层(基于J1939-11/15)

速率:250kbit/s
差动电压方式传输,隐性电压均为2.5,显性电压1.5,3.5
终端电阻:120欧
最大传输线长40m
同一网络最多ECU个数为30

J1939数据链路层(基于J1939-21)

优先级/P 扩展数据页/EDP 数据页/DP PDU格式/PF 特定PDU/PS 源地址/SA DATA
3bit 1bit 1bit 8bit 8bit 8bit 0~64bit

P:Priority,优先级,调整该值可改变报文在总线上的仲裁优先级
These three bits are used to optimize message latency for transmission onto the bus only. They should be globally
masked off by the receiver (ignored). The priority of any message can be set from highest, 0 (0002), to lowest, 7 (1112).
The default for all control oriented messages is 3 (0112). The default for all other informational, proprietary, request, and
ACK messages is 6 (1102). This permits the priority to be raised or lowered in the future as new PGNs are assigned and
bus traffic changes. A recommended priority is assigned to each PGN when it is added to the application layer document.
However, the priority field should be reprogrammable to allow for network tuning by the OEM should the need arise

EDP及DP:扩展数据页及数据页,当前均为0
The Extended Data Page bit is used in conjunction with the Data Page bit to determine the structure of the CAN identifier
of the CAN data frame. All J1939 messages should set the Extended Data Page bit to ZERO on transmit. See Table 3,
Definition of Extended Data Page and Data Page Use, to find the defined uses of the EDP and DP fields. Future
definitions might possibly be expanding the PDU Format field, defining new PDU formats, or increasing the address
space

Extended Data Page bit 25 CAN ID bit 25 Data Page bit 24 CAN ID bit 24 Description
0 0 SAE J1939 page 0 PGNs
0 1 SAE J1939 page 1 PGNs
1 0 SAE J1939 reserved
1 1 ISO 15765-3 defined

PF:PDU format,确定PDU格式,如PF值区间为0~239(0x00~0xEF),则表明是PDU1格式,如区间为240~255(0xF0~0xFF),则表明是PDU2格式。该场是PGN的组成部分
PS:PDU Specific,如为PUD1格式,则该场表示帧的目标地址,如为PDU2格式,则表示组扩展GE(用于扩展PGN的个数)

PDU Format Field PDU Specific Field
PDU1 Format 0-239 Destination Address
PDU2 Format 240-255 Group Extension

SA:Source Address,源地址
The Source Address field is 8 bits long. There shall only be one device on the network with a given source address.
Therefore, the source address field assures that the CAN identifier is unique, as required by CAN. Address management
and allocation is detailed in SAE J1939-81. Procedures are defined in SAE J1939-81 to prevent duplication of source
addresses. Reference SAE J1939 Appendix B, Tables B2 through B9, for source address assignments

在ID场中,Priority值根据需要调整,EDP和DP一般均为0,PF和PS决定了报文的PGN,SA体现了报文的发送节点。

请求PGN

PGN55904(EA00)专门用于数据请求

定义:用于从一个或多个网络设备请求参数组
速率:用户定义,推荐每秒不多于2~3次
数据长度:3字节
数据页:0
PDU格式:234(EA)
PDU特定域:目标地址
缺省优先级:6
参数组编号:59904(EA00)
参数定义:字节1,2,3位被请求参数组编号

例如:请求发动机转速
Send:18EA00FF 04 F0 00
recv:0CF00400 00 00 00 00 00 00 00 00

多帧传输

定义
缩写 英文 释义
TP Transport Protocol 传输协议
CM Connection Management 连接管理
RTS Request to Send 请求发送
CTS Clear to Send 允许发送
DT Data Transmission 数据传输
BAM Broadcast Announce Message 广播报文

TP.CM

数据 Byte0 Byte1 Byte2 Byte3 Byte4 Byte5 Byte6 Byte7
TP.CM 控制字 报文字节数 全部数据包数 最大数据包数 能够发送的数据包数 要发送的下一个数据包数 包编号
TP.CM.RTS 16 整个报文的字节数 全部数据包数 最大数据包(默认FF) PGN
TP.CM.CTS 17 能够发送的包数(不超过RTS[4]) 要发送下一数据包编号 FF FF PGN
TP.CM.Abort 255 放弃连接原因 FF FF FF PGN
TP.CM.EndofMsgAsk 19 整个报文字节数 全部数据包数 FF PGN
请求多帧示例

T:18EA0081 EC FE 00
R:18EC8100 10 12 00 03 FF EC FE 00
T:18EC0081 11 03 01 FF FF EC FE 00
R:18EB8100 01 XX XX XX XX XX XX XX
R:18EB8100 02 XX XX XX XX XX XX XX
R:18EB8100 03 XX XX XX XX FF FF FF
T:18EC0081 13 12 00 03 FF EC FE 00

J1939网络层(基于J1939-31)

J1939应用层(基于J1939-71)

This particular SAE Recommended Practice, SAE J1939-71, describes an Application Layer for
vehicle use.
定义SPN与PGN

J1939网络管理(基于J1939-81)

J1939诊断(基于J1939-13/73)

DM1 Diagnostic Message 1, Active Diagnostic Trouble Codes
DM2 Diagnostic Message 2, Previously Active Diagnostic Trouble Codes
DM3 Diagnostic Message 3, Diagnostic Data Clear/Reset For Previously Active DTCs
DM4 Diagnostic Message 4, Freeze Frame Parameters
DM5 Diagnostic Message 5, Diagnostic Readiness
DM6 Diagnostic Message 6, Continuously Monitored Systems Test Results
DM7 Diagnostic Message 7, Command Non-Continuously Monitored Test
DM8 Diagnostic Message 8, Test Results For Non-Continuously Monitored Systems
DM9 Diagnostic Message 9, Oxygen Sensor Test Results
DM10 Diagnostic Message 10, Non-Continuously Monitored Systems Test IDs Support
DM11 Diagnostic Message 11, Diagnostic Data Clear/Reset For Active DTCs
DM12 Diagnostic Message 12, Emissions Related Active DTCs
DTC Diagnostic Trouble Code
FTP Federal Test Procedure
MIL Malfunction Indicator Lamp
NA Not applicable
PID Parameter Identifier (SAE J1587 or SAE J1979)
OBD II On Board Diagnostics II