AUTOSAR CP DCM UDS服务列表 / AUTOSAR CP DCM UDS Services List

本文档列出了AUTOSAR CP R23-11规范中DCM支持的所有UDS服务。/ This document lists all UDS services supported by DCM in AUTOSAR CP R23-11 specification.


目录 / Table of Contents

一、[服务列表概览 / Services Overview](#一、服务列表概览 / Services Overview)
二、[服务详情 / Service Details](#二、服务详情 / Service Details)
三、[NRC列表 / NRC List](#三、NRC列表 / NRC List)


一、服务列表概览 / Services Overview

编号 SID 服务名称 / Service Name 支持状态 / Support Status
1 0x10 DiagnosticSessionControl (诊断会话控制) Supported
2 0x11 ECUReset (ECU重置) Supported
3 0x14 ClearDiagnosticInformation (清除诊断信息) Supported
4 0x19 ReadDTCInformation (读取DTC信息) Supported
5 0x22 ReadDataByIdentifier (按标识符读取数据) Supported
6 0x23 ReadMemoryByAddress (按地址读取内存) Supported (callout)
7 0x24 ReadScalingDataByIdentifier (按标识符读取缩放数据) Supported
8 0x27 SecurityAccess (安全访问) Supported
9 0x28 CommunicationControl (通信控制) Supported
10 0x29 Authentication (认证) Supported
11 0x2A ReadDataByPeriodicIdentifier (按周期标识符读取数据) Supported
12 0x2C DynamicallyDefineDataIdentifier (动态定义数据标识符) Supported
13 0x2E WriteDataByIdentifier (按标识符写入数据) Supported
14 0x2F InputOutputControlByIdentifier (按标识符输入输出控制) Supported
15 0x31 RoutineControl (例程控制) Supported
16 0x34 RequestDownload (请求下载) Supported (callout)
17 0x35 RequestUpload (请求上传) Supported (callout)
18 0x36 TransferData (传输数据) Supported
19 0x37 RequestTransferExit (请求传输退出) Supported
20 0x38 RequestFileTransfer (请求文件传输) Supported (callout)
21 0x3D WriteMemoryByAddress (按地址写入内存) Supported (callout)
22 0x3E TesterPresent (测试仪在线) Supported
23 0x85 ControlDTCSetting (控制DTC设置) Supported
24 0x86 ResponseOnEvent (事件响应) Supported
25 0x87 LinkControl (链路控制) User optional

二、服务详情 / Service Details

1. 0x10 - DiagnosticSessionControl (诊断会话控制 / Diagnostic Session Control)

服务描述 / Service Description:
允许外部测试仪启用服务器中的不同诊断会话。诊断会话启用服务器中的特定诊断服务和/或功能。/ Allows an external tester to enable different diagnostic sessions in the server. A diagnostic session enables a specific set of diagnostic services and/or functionality in the server.

数据封装格式 / Data Format:

方向 / Direction 字节1 / Byte 1 字节2 / Byte 2 字节3-n / Bytes 3-n
请求 / Request SID = 0x10 diagnosticSessionType -
积极响应 / Positive Response SID+0x40 = 0x50 diagnosticSessionType sessionParameterRecord
消极响应 / Negative Response 0x7F SID (0x10) NRC
子功能 / Sub-Functions (diagnosticSessionType)
SubFunction 名称 / Name 积极响应内容 / Positive Response Content
0x01 defaultSession (默认会话) P2ServerMax, P2StarServerMax
0x02 programmingSession (编程会话) P2ServerMax, P2StarServerMax
0x03 extendedDiagnosticSession (扩展诊断会话) P2ServerMax, P2StarServerMax
0x04 safetySystemDiagnosticSession (安全系统诊断会话) P2ServerMax, P2StarServerMax
请求示例 / Request Example
10 01  →  请求进入默认会话 / Request to enter default session
积极响应示例 / Positive Response Example
50 01 XX XX YY YY  →  积极响应,会话类型0x01,P2ServerMax=XX XX,P2StarServerMax=YY YY
消极响应示例 / Negative Response Example
7F 10 12  →  消极响应,服务0x10,NRC=0x12(SubFunction not supported)

2. 0x11 - ECUReset (ECU重置 / ECU Reset)

服务描述 / Service Description:
允许外部测试仪请求服务器重置。/ Allows an external tester to request a server reset.

数据封装格式 / Data Format:

方向 / Direction 字节1 / Byte 1 字节2 / Byte 2 字节3 / Byte 3
请求 / Request SID = 0x11 resetType -
积极响应 / Positive Response SID+0x40 = 0x51 resetType powerDownTime (可选)
消极响应 / Negative Response 0x7F SID (0x11) NRC
子功能 / Sub-Functions (resetType)
SubFunction 名称 / Name 说明 / Description
0x01 hardReset (硬复位) 执行硬件复位 / Execute hardware reset
0x02 keyOffOnReset (钥匙开关复位) 执行钥匙开关复位 / Execute key-off-on reset
0x03 softReset (软复位) 执行软件复位 / Execute software reset
0x04 enableRapidPowerShutDown (快速断电使能) 使能快速断电 / Enable rapid power shutdown
0x05 disableRapidPowerShutDown (快速断电禁用) 禁用快速断电 / Disable rapid power shutdown
请求示例 / Request Example
11 01  →  请求硬复位 / Request hard reset
积极响应示例 / Positive Response Example
51 01  →  积极响应,确认硬复位 / Positive response, hard reset confirmed
消极响应示例 / Negative Response Example
7F 11 12  →  消极响应,服务0x11,NRC=0x12(SubFunction not supported)

3. 0x14 - ClearDiagnosticInformation (清除诊断信息 / Clear Diagnostic Information)

服务描述 / Service Description:
请求ECU清除错误内存。/ Requests an ECU to clear the error memory.

数据封装格式 / Data Format:

方向 / Direction 字节1 / Byte 1 字节2 / Byte 2 字节3 / Byte 3 字节4 / Byte 4
请求 / Request SID = 0x14 groupOfDTC (高字节) groupOfDTC (中字节) groupOfDTC (低字节)
积极响应 / Positive Response SID+0x40 = 0x54 - - -
消极响应 / Negative Response 0x7F SID (0x14) NRC -
请求示例 / Request Example
14 FF FF FF  →  请求清除所有DTC / Request to clear all DTCs
积极响应示例 / Positive Response Example
54  →  积极响应,DTC清除成功 / Positive response, DTC cleared successfully
消极响应示例 / Negative Response Example
7F 14 33  →  消极响应,服务0x14,NRC=0x33(Security Access Denied)

4. 0x19 - ReadDTCInformation (读取DTC信息 / Read DTC Information)

服务描述 / Service Description:
允许客户端读取服务器驻留的诊断故障代码(DTC)信息。/ Allows a client to read the status of server resident Diagnostic Trouble Code (DTC) information.

数据封装格式 / Data Format:

方向 / Direction 字节1 / Byte 1 字节2 / Byte 2 字节3-n / Bytes 3-n
请求 / Request SID = 0x19 SubFunction 相关参数
积极响应 / Positive Response SID+0x40 = 0x59 SubFunction DTC信息
消极响应 / Negative Response 0x7F SID (0x19) NRC
子功能 / Sub-Functions
SubFunction 名称 / Name
0x01 reportNumberOfDTCByStatusMask (按状态掩码报告DTC数量)
0x02 reportDTCByStatusMask (按状态掩码报告DTC)
0x03 reportDTCSnapshotIdentification (报告DTC快照标识)
0x04 reportDTCSnapshotRecordByDTCNumber (按DTC号报告DTC快照记录)
0x05 reportDTCExtendedDataRecordByDTCNumber (按DTC号报告DTC扩展数据记录)
0x06 reportDTCBySeverityMaskRecord (按严重性掩码记录报告DTC)
0x07 reportNumberOfDTCBySeverityMask (按严重性掩码报告DTC数量)
0x08 reportDTCSeverityInformation (报告DTC严重性信息)
0x09 reportDTCCountBySeverityMaskRecord (按严重性掩码记录报告DTC计数)
0x0A reportSupportedDTCs (报告支持的DTC)
0x0B reportFirstTestFailedDTC (报告首次测试失败的DTC)
0x0C reportFirstConfirmedDTC (报告首次确认的DTC)
0x0D reportMostRecentTestFailedDTC (报告最近测试失败的DTC)
0x0E reportMostRecentConfirmedDTC (报告最近确认的DTC)
0x0F reportMirrorMemoryDTCByStatusMask (按状态掩码报告镜像内存DTC)
0x10 reportMirrorMemoryDTCExtDataRecordByDTCNumber
0x11 reportCountOfMirrorMemoryDTCs (报告镜像内存DTC计数)
0x12 reportNumberOfDTCByRecordNumber (按记录号报告DTC数量)
0x13 reportUserDefMemoryDTCByStatusMask
0x14 reportUserDefMemoryDTCExtDataRecordByDTCNumber
0x15 reportUserDefMemoryDTCSnapshotRecordByDTCNumber
0x16 reportUserDefMemoryDTCSnapshotIdentification
0x17 reportUserDefMemoryMostRecentConfirmedDTC
0x18 reportDTCWithPermanentStatus (报告永久状态DTC)
0x1A reportUserDefMemoryDTCBySeverityMaskRecord
0x42 reportAllDTCs (报告所有DTC)
0x55 reportDTCsByEmissionRelatedOBD
0x56 reportAllOnBoardDTCs (报告所有OBD DTC)
请求示例 / Request Example
19 01 01  →  请求按状态掩码0x01报告DTC数量 / Request DTC count by status mask 0x01
积极响应示例 / Positive Response Example
59 01 09 01 00 03  →  积极响应,子功能0x01,DTC状态可用掩码=0x09,DTC格式标识=0x01,DTC计数=0x0003
消极响应示例 / Negative Response Example
7F 19 31  →  消极响应,服务0x19,NRC=0x31(Request Out Of Range)

5. 0x22 - ReadDataByIdentifier (按标识符读取数据 / Read Data By Identifier)

服务描述 / Service Description:
允许客户端通过数据标识符(DID)读取服务器中的数据记录。/ Allows a client to read data records from the server by data identifier (DID).

数据封装格式 / Data Format:

方向 / Direction 字节1 / Byte 1 字节2 / Byte 2 字节3 / Byte 3 字节4-n / Bytes 4-n
请求 / Request SID = 0x22 dataIdentifier (高字节) dataIdentifier (低字节) -
积极响应 / Positive Response SID+0x40 = 0x62 dataIdentifier (高字节) dataIdentifier (低字节) dataRecord
消极响应 / Negative Response 0x7F SID (0x22) NRC -
请求示例 / Request Example
22 F1 86  →  请求读取DID 0xF186 (ActiveDiagnosticSession) / Request to read DID 0xF186
积极响应示例 / Positive Response Example
62 F1 86 01 00  →  积极响应,DID=0xF186,数据=01 00
消极响应示例 / Negative Response Example
7F 22 31  →  消极响应,服务0x22,NRC=0x31(Request Out Of Range)

6. 0x23 - ReadMemoryByAddress (按地址读取内存 / Read Memory By Address)

服务描述 / Service Description:
允许客户端通过地址和长度读取服务器内存。/ Allows a client to read server memory by address and length.

数据封装格式 / Data Format:

方向 / Direction 字节1 / Byte 1 字节2 / Byte 2 字节3-n / Bytes 3-n
请求 / Request SID = 0x23 addressAndLengthFormatIdentifier memoryAddress + memoryLength
积极响应 / Positive Response SID+0x40 = 0x63 dataRecord -
消极响应 / Negative Response 0x7F SID (0x23) NRC
请求示例 / Request Example
23 24 10 11 00 01  →  请求从地址0x101100读取1字节 / Request to read 1 byte from address 0x101100
积极响应示例 / Positive Response Example
63 AA  →  积极响应,数据=0xAA / Positive response, data=0xAA
消极响应示例 / Negative Response Example
7F 23 31  →  消极响应,服务0x23,NRC=0x31(Request Out Of Range)

7. 0x24 - ReadScalingDataByIdentifier (按标识符读取缩放数据 / Read Scaling Data By Identifier)

服务描述 / Service Description:
允许客户端获取DID的缩放信息。/ Allows a client to obtain scaling information for a DID.

数据封装格式 / Data Format:

方向 / Direction 字节1 / Byte 1 字节2 / Byte 2 字节3 / Byte 3 字节4-n / Bytes 4-n
请求 / Request SID = 0x24 dataIdentifier (高字节) dataIdentifier (低字节) -
积极响应 / Positive Response SID+0x40 = 0x64 dataIdentifier (高字节) dataIdentifier (低字节) scalingDataRecord
消极响应 / Negative Response 0x7F SID (0x24) NRC -
请求示例 / Request Example
24 10 00  →  请求获取DID 0x1000的缩放信息 / Request scaling info for DID 0x1000
积极响应示例 / Positive Response Example
64 10 00 XX YY ...  →  积极响应,DID=0x1000,缩放数据=...
消极响应示例 / Negative Response Example
7F 24 31  →  消极响应,服务0x24,NRC=0x31(Request Out Of Range)

8. 0x27 - SecurityAccess (安全访问 / Security Access)

服务描述 / Service Description:
提供获取和释放服务器安全性的方法。/ Provides a method to obtain and release server security.

数据封装格式 / Data Format:

方向 / Direction 字节1 / Byte 1 字节2 / Byte 2 字节3-n / Bytes 3-n
请求 / Request SID = 0x27 securityAccessType securityKey (可选)
积极响应 / Positive Response SID+0x40 = 0x67 securityAccessType securitySeed (可选)
消极响应 / Negative Response 0x7F SID (0x27) NRC
子功能 / Sub-Functions (securityAccessType)
SubFunction 名称 / Name 说明 / Description
0x01 requestSeed (请求种子) 请求安全级别1的种子 / Request seed for security level 1
0x02 sendKey (发送密钥) 发送安全级别1的密钥 / Send key for security level 1
0x03 requestSeed (请求种子) 请求安全级别2的种子 / Request seed for security level 2
0x04 sendKey (发送密钥) 发送安全级别2的密钥 / Send key for security level 2
0x05-0x0D requestSeed/sendKey 安全级别3-13 / Security levels 3-13
0x0E-0x0F requestSeed/sendKey 安全级别14 / Security level 14
0x11-0x12 requestSeed/sendKey 安全级别17 / Security level 17
0x40-0x41 requestSeed/sendKey 安全级别0 / Security level 0
请求示例 / Request Example
27 01  →  请求安全级别1的种子 / Request seed for security level 1
积极响应示例 / Positive Response Example
67 01 12 34 56 78  →  积极响应,子功能0x01,种子=0x12345678
消极响应示例 / Negative Response Example
7F 27 33  →  消极响应,服务0x27,NRC=0x33(Security Access Denied)

9. 0x28 - CommunicationControl (通信控制 / Communication Control)

服务描述 / Service Description:
允许客户端启用/禁用服务器传输和/或接收诊断报文。/ Allows a client to enable/disable server transmission and/or reception of diagnostic messages.

数据封装格式 / Data Format:

方向 / Direction 字节1 / Byte 1 字节2 / Byte 2 字节3 / Byte 3 (可选)
请求 / Request SID = 0x28 communicationControlType subnetNumber (可选)
积极响应 / Positive Response SID+0x40 = 0x68 communicationControlType -
消极响应 / Negative Response 0x7F SID (0x28) NRC
子功能 / Sub-Functions
SubFunction 名称 / Name
0x00 enableRxAndTx (使能接收和发送)
0x01 enableRxAndDisableTx (使能接收禁用发送)
0x02 disableRxAndEnableTx (禁用接收使能发送)
0x03 disableRxAndTx (禁用接收和发送)
0x04 enableRxAndTxWithEnhancedAddressInformation
请求示例 / Request Example
28 03  →  请求禁用接收和发送 / Request to disable RX and TX
积极响应示例 / Positive Response Example
68 03  →  积极响应,确认禁用通信 / Positive response, communication disabled

10. 0x29 - Authentication (认证 / Authentication)

服务描述 / Service Description:
提供基于证书的认证机制。/ Provides certificate-based authentication mechanism.

数据封装格式 / Data Format:

方向 / Direction 字节1 / Byte 1 字节2 / Byte 2 字节3-n / Bytes 3-n
请求 / Request SID = 0x29 subFunction 认证参数
积极响应 / Positive Response SID+0x40 = 0x69 subFunction 认证返回参数
消极响应 / Negative Response 0x7F SID (0x29) NRC
子功能 / Sub-Functions
SubFunction 名称 / Name
0x01 deAuthenticate (去认证)
0x02 verifyCertificateUnidirectional (单向证书验证)
0x03 verifyCertificateBidirectional (双向证书验证)
0x04 proofOfOwnership (所有权证明)
0x05 authenticate (认证)
请求示例 / Request Example
29 01  →  请求去认证 / Request de-authentication
积极响应示例 / Positive Response Example
69 01 00  →  积极响应,去认证成功 / Positive response, de-authentication successful

11. 0x2A - ReadDataByPeriodicIdentifier (按周期标识符读取数据 / Read Data By Periodic Identifier)

服务描述 / Service Description:
允许客户端请求服务器周期性传输数据记录。/ Allows a client to request the server to transmit data records periodically.

数据封装格式 / Data Format:

方向 / Direction 字节1 / Byte 1 字节2 / Byte 2 字节3-n / Bytes 3-n
请求 / Request SID = 0x2A transmissionMode periodicDataIdentifier[]
积极响应 / Positive Response SID+0x40 = 0x6A periodicDataIdentifier[] dataRecord[]
消极响应 / Negative Response 0x7F SID (0x2A) NRC
子功能 / Sub-Functions (transmissionMode)
SubFunction 名称 / Name
0x01 sendAtSlowRate (慢速发送)
0x02 sendAtMediumRate (中速发送)
0x03 sendAtFastRate (快速发送)
0x04 stopSending (停止发送)
请求示例 / Request Example
2A 01 F1 A0  →  请求以慢速周期发送DID 0xF1A0

12. 0x2C - DynamicallyDefineDataIdentifier (动态定义数据标识符 / Dynamically Define Data Identifier)

服务描述 / Service Description:
允许客户端动态定义数据标识符。/ Allows a client to dynamically define data identifiers.

数据封装格式 / Data Format:

方向 / Direction 字节1 / Byte 1 字节2 / Byte 2 字节3-n / Bytes 3-n
请求 / Request SID = 0x2C subFunction 定义参数
积极响应 / Positive Response SID+0x40 = 0x6C subFunction 定义数据
消极响应 / Negative Response 0x7F SID (0x2C) NRC
子功能 / Sub-Functions
SubFunction 名称 / Name
0x01 defineByIdentifier (按标识符定义)
0x02 defineByMemoryAddress (按内存地址定义)
0x03 clearDynamicallyDefinedDataIdentifier (清除动态定义的DID)
请求示例 / Request Example
2C 01 F2 00 F1 10 F1 20  →  定义动态DID 0xF200,由DID 0xF110和0xF120组成

13. 0x2E - WriteDataByIdentifier (按标识符写入数据 / Write Data By Identifier)

服务描述 / Service Description:
允许客户端通过数据标识符(DID)写入数据到服务器。/ Allows a client to write data to the server by data identifier (DID).

数据封装格式 / Data Format:

方向 / Direction 字节1 / Byte 1 字节2 / Byte 2 字节3 / Byte 3 字节4-n / Bytes 4-n
请求 / Request SID = 0x2E dataIdentifier (高字节) dataIdentifier (低字节) dataRecord
积极响应 / Positive Response SID+0x40 = 0x6E dataIdentifier (高字节) dataIdentifier (低字节) -
消极响应 / Negative Response 0x7F SID (0x2E) NRC -
请求示例 / Request Example
2E F1 10 12 34  →  请求写入DID 0xF110,数据=0x1234
积极响应示例 / Positive Response Example
6E F1 10  →  积极响应,确认写入DID 0xF110 / Positive response, DID 0xF110 write confirmed
消极响应示例 / Negative Response Example
7F 2E 33  →  消极响应,服务0x2E,NRC=0x33(Security Access Denied)

14. 0x2F - InputOutputControlByIdentifier (按标识符输入输出控制 / Input Output Control By Identifier)

服务描述 / Service Description:
允许客户端控制服务器的输入输出。/ Allows a client to control server input and output.

数据封装格式 / Data Format:

方向 / Direction 字节1 / Byte 1 字节2 / Byte 2 字节3 / Byte 3 字节4 / Byte 4 字节5-n / Bytes 5-n
请求 / Request SID = 0x2F dataIdentifier (高字节) dataIdentifier (低字节) inputOutputControlParameter controlStateRecord
积极响应 / Positive Response SID+0x40 = 0x6F dataIdentifier (高字节) dataIdentifier (低字节) controlStatusRecord -
消极响应 / Negative Response 0x7F SID (0x2F) NRC - -
子功能 / Sub-Functions
SubFunction 名称 / Name
0x00 returnControlToECU (返回控制给ECU)
0x01 resetToDefault (复位到默认值)
0x02 freezeCurrentState (冻结当前状态)
0x03 shortTermAdjustment (短期调整)
请求示例 / Request Example
2F F1 00 00  →  请求返回控制权给ECU for DID 0xF100
积极响应示例 / Positive Response Example
6F F1 00 00  →  积极响应,控制权已返回 / Positive response, control returned

15. 0x31 - RoutineControl (例程控制 / Routine Control)

服务描述 / Service Description:
允许客户端启动/停止服务器上的例程。/ Allows a client to start/stop routines on the server.

数据封装格式 / Data Format:

方向 / Direction 字节1 / Byte 1 字节2 / Byte 2 字节3 / Byte 3 字节4 / Byte 4 字节5-n / Bytes 5-n
请求 / Request SID = 0x31 subFunction routineIdentifier (高字节) routineIdentifier (低字节) routineControlOptionRecord
积极响应 / Positive Response SID+0x40 = 0x71 subFunction routineIdentifier (高字节) routineIdentifier (低字节) routineStatusRecord
消极响应 / Negative Response 0x7F SID (0x31) NRC - -
子功能 / Sub-Functions
SubFunction 名称 / Name
0x01 startRoutine (启动例程)
0x02 stopRoutine (停止例程)
0x03 requestRoutineResults (请求例程结果)
请求示例 / Request Example
31 01 03 01  →  启动RID 0x0301的例程 / Start routine with RID 0x0301
积极响应示例 / Positive Response Example
71 01 03 01 00  →  积极响应,例程已启动 / Positive response, routine started
消极响应示例 / Negative Response Example
7F 31 33  →  消极响应,服务0x31,NRC=0x33(Security Access Denied)

16. 0x34 - RequestDownload (请求下载 / Request Download)

服务描述 / Service Description:
请求从客户端向服务器下载数据。/ Requests to download data from the client to the server.

数据封装格式 / Data Format:

方向 / Direction 字节1 / Byte 1 字节2 / Byte 2 字节3 / Byte 3 字节4-n / Bytes 4-n
请求 / Request SID = 0x34 dataFormatIdentifier addressAndLengthFormatIdentifier memoryAddress + memoryLength
积极响应 / Positive Response SID+0x40 = 0x74 dataFormatIdentifier lengthFormatIdentifier maxNumberOfBlockLength
消极响应 / Negative Response 0x7F SID (0x34) NRC -
请求示例 / Request Example
34 00 44 10 00 00 00 00 20 00  →  请求下载,地址0x10000000,长度0x2000
积极响应示例 / Positive Response Example
74 00 20 10 00  →  积极响应,最大块长度=0x1000 / Positive response, max block length=0x1000

17. 0x35 - RequestUpload (请求上传 / Request Upload)

服务描述 / Service Description:
请求从服务器向客户端上传数据。/ Requests to upload data from the server to the client.

数据封装格式 / Data Format:

方向 / Direction 字节1 / Byte 1 字节2 / Byte 2 字节3 / Byte 3 字节4-n / Bytes 4-n
请求 / Request SID = 0x35 dataFormatIdentifier addressAndLengthFormatIdentifier memoryAddress + memoryLength
积极响应 / Positive Response SID+0x40 = 0x75 dataFormatIdentifier lengthFormatIdentifier maxNumberOfBlockLength
消极响应 / Negative Response 0x7F SID (0x35) NRC -
请求示例 / Request Example
35 00 44 10 00 00 00 00 20 00  →  请求上传,地址0x10000000,长度0x2000

18. 0x36 - TransferData (传输数据 / Transfer Data)

服务描述 / Service Description:
在客户端和服务器之间传输数据块。/ Transfers data blocks between client and server.

数据封装格式 / Data Format:

方向 / Direction 字节1 / Byte 1 字节2 / Byte 2 字节3-n / Bytes 3-n
请求 / Request SID = 0x36 blockSequenceCounter dataRecord
积极响应 / Positive Response SID+0x40 = 0x76 blockSequenceCounter transferResponseParameterRecord
消极响应 / Negative Response 0x7F SID (0x36) NRC
请求示例 / Request Example
36 01 00 01 02 03 04 05 06 07  →  传输第1块数据 / Transfer block 1 data
积极响应示例 / Positive Response Example
76 01  →  积极响应,确认第1块 / Positive response, block 1 confirmed

19. 0x37 - RequestTransferExit (请求传输退出 / Request Transfer Exit)

服务描述 / Service Description:
请求退出数据传输。/ Requests to exit data transfer.

数据封装格式 / Data Format:

方向 / Direction 字节1 / Byte 1 字节2-n / Bytes 2-n
请求 / Request SID = 0x37 transferRequestParameterRecord (可选)
积极响应 / Positive Response SID+0x40 = 0x77 transferResponseParameterRecord (可选)
消极响应 / Negative Response 0x7F SID (0x37)
请求示例 / Request Example
37  →  请求退出传输 / Request to exit transfer
积极响应示例 / Positive Response Example
77  →  积极响应,传输已退出 / Positive response, transfer exited

20. 0x38 - RequestFileTransfer (请求文件传输 / Request File Transfer)

服务描述 / Service Description:
用于启动文件传输过程。/ Used to initiate a file transfer process.

数据封装格式 / Data Format:

方向 / Direction 字节1 / Byte 1 字节2 / Byte 2 字节3-n / Bytes 3-n
请求 / Request SID = 0x38 modeOfOperation filePathAndName + [dataFormatDefinition] + fileSizeParameterLength + fileSizeOrDirInfoParameterLength
积极响应 / Positive Response SID+0x40 = 0x78 modeOfOperation responseParameterRecord
消极响应 / Negative Response 0x7F SID (0x38) NRC
子功能 / Sub-Functions (modeOfOperation)
SubFunction 名称 / Name
0x01 AddFile (添加文件)
0x02 DeleteFile (删除文件)
0x03 ReplaceFile (替换文件)
0x04 ReadFile (读取文件)
0x05 ReadDir (读取目录)
请求示例 / Request Example
38 01 00 05 file.bin 00 00 00 10  →  添加文件file.bin,大小0x10字节 / Add file file.bin, size 0x10 bytes

21. 0x3D - WriteMemoryByAddress (按地址写入内存 / Write Memory By Address)

服务描述 / Service Description:
允许客户端通过地址和长度写入服务器内存。/ Allows a client to write server memory by address and length.

数据封装格式 / Data Format:

方向 / Direction 字节1 / Byte 1 字节2 / Byte 2 字节3-n / Bytes 3-n
请求 / Request SID = 0x3D addressAndLengthFormatIdentifier memoryAddress + memoryLength + dataRecord
积极响应 / Positive Response SID+0x40 = 0x7D addressAndLengthFormatIdentifier memoryAddress + memoryLength
消极响应 / Negative Response 0x7F SID (0x3D) NRC
请求示例 / Request Example
3D 24 10 00 00 00 10 00 AA BB CC DD  →  从地址0x10000000写入4字节 / Write 4 bytes from address 0x10000000
积极响应示例 / Positive Response Example
7D 24 10 00 00 00 10 00  →  积极响应,确认写入 / Positive response, write confirmed
消极响应示例 / Negative Response Example
7F 3D 31  →  消极响应,服务0x3D,NRC=0x31(Request Out Of Range)

22. 0x3E - TesterPresent (测试仪在线 / Tester Present)

服务描述 / Service Description:
向服务器指示测试仪仍然连接。/ Indicates to the server that the tester is still connected.

数据封装格式 / Data Format:

方向 / Direction 字节1 / Byte 1 字节2 / Byte 2
请求 / Request SID = 0x3E zeroSubFunction = 0x00
积极响应 / Positive Response SID+0x40 = 0x7E zeroSubFunction = 0x00
消极响应 / Negative Response 0x7F SID (0x3E)
请求示例 / Request Example
3E 00  →  测试仪在线 / Tester present
积极响应示例 / Positive Response Example
7E 00  →  积极响应,确认在线 / Positive response, tester present confirmed
消极响应示例 / Negative Response Example
7F 3E 12  →  消极响应,服务0x3E,NRC=0x12(SubFunction not supported)

23. 0x85 - ControlDTCSetting (控制DTC设置 / Control DTC Setting)

服务描述 / Service Description:
允许外部测试工具请求ECU禁用或启用DTC存储。/ Allows an external test tool to request an ECU to disable or enable DTC storage.

数据封装格式 / Data Format:

方向 / Direction 字节1 / Byte 1 字节2 / Byte 2 字节3-5 / Bytes 3-5 (可选)
请求 / Request SID = 0x85 DTCSettingType DTCSettingControlOptionRecord
积极响应 / Positive Response SID+0x40 = 0xC5 DTCSettingType -
消极响应 / Negative Response 0x7F SID (0x85) NRC
子功能 / Sub-Functions
SubFunction 名称 / Name 说明 / Description
0x01 ON (DTC设置开启) 启用DTC存储 / Enable DTC storage
0x02 OFF (DTC设置关闭) 禁用DTC存储 / Disable DTC storage
请求示例 / Request Example
85 01  →  请求开启DTC设置 / Request to enable DTC setting
积极响应示例 / Positive Response Example
C5 01  →  积极响应,确认开启DTC设置 / Positive response, DTC setting enabled
消极响应示例 / Negative Response Example
7F 85 12  →  消极响应,服务0x85,NRC=0x12(SubFunction not supported)

24. 0x86 - ResponseOnEvent (事件响应 / Response On Event)

服务描述 / Service Description:
请求服务器启动或停止由指定服务器事件触发的响应传输。/ Requests the server to start or stop the transmission of responses initiated by a specified server event.

数据封装格式 / Data Format:

方向 / Direction 字节1 / Byte 1 字节2 / Byte 2 字节3 / Byte 3 字节4 / Byte 4 字节5-n / Bytes 5-n
请求 / Request SID = 0x86 subFunction eventType eventWindowTime storeEvent (可选) + responseFormat (可选)
积极响应 / Positive Response SID+0x40 = 0xC6 subFunction eventType numberOfActivatedEvents -
消极响应 / Negative Response 0x7F SID (0x86) NRC - -
子功能 / Sub-Functions
SubFunction 名称 / Name
0x01 stopResponseOnEvent (停止事件响应)
0x02 onDTCStatusChange (DTC状态变化)
0x03 onTimerInterrupt (定时器中断)
0x04 onChangeOfDataIdentifier (数据标识符变化)
0x05 onComparisonOfValue (值比较)
0x06 startResponseOnEvent (启动事件响应)
0x07 clearResponseOnEvent (清除事件响应)
请求示例 / Request Example
86 01  →  请求停止事件响应 / Request to stop response on event
积极响应示例 / Positive Response Example
C6 01 01  →  积极响应,1个事件已激活 / Positive response, 1 event activated

25. 0x87 - LinkControl (链路控制 / Link Control)

服务描述 / Service Description:
允许客户端控制服务器的网络层设置。/ Allows a client to control the server’s network layer settings.

数据封装格式 / Data Format:

方向 / Direction 字节1 / Byte 1 字节2 / Byte 2 字节3-n / Bytes 3-n
请求 / Request SID = 0x87 subFunction linkControlParameter (可选)
积极响应 / Positive Response SID+0x40 = 0xC7 subFunction -
消极响应 / Negative Response 0x7F SID (0x87) NRC
子功能 / Sub-Functions
SubFunction 名称 / Name 说明 / Description
0x01 IsolateServer (隔离服务器) 隔离服务器网络 / Isolate server network
0x02 ConnectToServer (连接服务器) 连接到服务器网络 / Connect to server network
请求示例 / Request Example
87 01  →  请求隔离服务器 / Request to isolate server
积极响应示例 / Positive Response Example
C7 01  →  积极响应,确认隔离服务器 / Positive response, server isolated
消极响应示例 / Negative Response Example
7F 87 12  →  消极响应,服务0x87,NRC=0x12(SubFunction not supported)

三、NRC列表 / NRC List

编号 NRC 名称 / Name 描述 / Description
1 0x10 GeneralReject 常规拒绝 / General reject
2 0x11 ResponsePending 响应待定 / Response pending
3 0x12 SubFunctionNotSupported 不支持子功能 / Sub-function not supported
4 0x13 IncorrectMessageLengthOrInvalidFormat 消息长度不正确或格式无效 / Incorrect message length or invalid format
5 0x14 ResponseTooLong 响应过长 / Response too long
6 0x21 BusyRepeatRequest 忙,请求重复 / Busy, repeat request
7 0x22 conditionsNotCorrect 条件不正确 / Conditions not correct
8 0x23 RoutineSequenceError 例程序列错误 / Routine sequence error
9 0x24 requestSequenceError 请求序列错误 / Request sequence error
10 0x25 NoResponseFromSubnetComponent 子网组件无响应 / No response from subnet component
11 0x26 FailurePreventsExecutionOfRequestedAction 故障阻止执行请求的操作 / Failure prevents execution of requested action
12 0x31 requestOutOfRange 请求超出范围 / Request out of range
13 0x33 SecurityAccessDenied 安全访问被拒绝 / Security access denied
14 0x34 AuthenticationFailure 认证失败 / Authentication failure
15 0x35 InvalidKey 无效密钥 / Invalid key
16 0x36 ExceededNumberOfAttempts 超出尝试次数 / Exceeded number of attempts
17 0x37 RequiredTimeDelayNotExpired 所需时间延迟未到期 / Required time delay not expired
18 0x38 AccessDenied 访问被拒绝 / Access denied
19 0x39-0x50 Reserved 预留 / Reserved
20 0x70 uploadDownloadNotAccepted 上传/下载不被接受 / Upload/download not accepted
21 0x71 transferDataSuspended 数据传输暂停 / Transfer data suspended
22 0x72 generalProgrammingFailure 常规编程失败 / General programming failure
23 0x73 WrongBlockSequenceCounter 错误的块序列计数器 / Wrong block sequence counter
24 0x74-0x77 Reserved 预留 / Reserved
25 0x78 ResponsePending 响应待定 (继续) / Response pending (continuation)
26 0x79-0x80 Reserved 预留 / Reserved
27 0x81 WrongMemoryAddress 错误的内存地址 / Wrong memory address
28 0x82 WrongMemoryRange 错误的内存范围 / Wrong memory range
29 0x83-0x8F Reserved 预留 / Reserved
30 0x90 SubFunctionNotSupportedInActiveSession 子功能在当前会话中不支持 / Sub-function not supported in active session
31 0x91 ServiceNotSupportedInActiveSession 服务在当前会话中不支持 / Service not supported in active session
32 0x92 voltageTooHigh 电压过高 / Voltage too high
33 0x93 voltageTooLow 电压过低 / Voltage too low
Logo

智能硬件社区聚焦AI智能硬件技术生态,汇聚嵌入式AI、物联网硬件开发者,打造交流分享平台,同步全国赛事资讯、开展 OPC 核心人才招募,助力技术落地与开发者成长。

更多推荐