汽车诊断之UDS入门-0x19 0x03/ 0x04服务

0x19 0x03 获取DTC快照记录ID

Subfunction=03 reportDTCSnapshotIdentification

client可以通过该子功能请求来检索所有捕获的 DTC快照记录的ID信息。服务器应返回所有已存储 DTC快照记录的 ID信息列表。服务器在响应消息中为单个 DTCSnapshot 记录放置的每个项目都应包含一个DTCRecord [包含 DTC number(high,middle,low字节)]和 DTCSnapshot record number。如果为单个 DTC 存储了多个DTCSnapshot 记录,则ECU应在每次响应时使用1个不同的DTCSnapshot record number(便于后续的查询)来表示。

ECU可支持对单个DTC存储多个DTCSnapshot records来跟踪每次DTC发生时的环境条件。DTCSnapshot records数量应被系统供应商或整车厂定义。

客户端成功发出 ClearDiagnosticInformation 请求后,应清除 DTCSnapshot 记录ID信息。 整车厂需要定义清楚删除已存储 DTC 和 DTCSnapshot 数据的规则以防内存溢出。

0x19 0x04 通过检索client定义的DTC mask获取DTCSnapshotRecordData

Subfunction=04 reportDTCSnapshotRecordByDTCNumber

该子功能可使client通过DTCSnapshot record number和DTCMaskRecord获得捕获的DTCSnapshot record data.

ECU应通过它支持的DTC来获取与之匹配的由client端定义的DTCMaskRecord(包括DTC number(high,middle,low byte)),client端请求中的UserDefDTCSnapshotRecordNumber参数应清楚定义请求的是某个DTC的哪个DTCSnapshot record data。

注意 1 :UserDefDTCSnapshotRecordNumber 参数与DTCStoredDataRecordNumber参数并不共享同样的地址。

如果ECU可支持对单个DTC存储多个DTCSnapshot records(该功能由系统供应商或整车厂定义)。ECU推荐client首先使用Subfunction=03 reportDTCSnapshotIdentification请求DTCSnapshotIdentification,然后再使用Subfunction=04 reportDTCSnapshotRecordByDTCNumber请求DTCSnapshotRecordNumber。

Subfunction=03 reportDTCSnapshotIdentification可使client识别ECU存储的DTCSnapshot records而不用解析ECU所有存储的DTC来确定某个DTCSnapshot记录是否被存储。

系统供应商 / 整车厂应负责定义在这些ECU中捕获的 DTCSnapshot 记录是否存储与故障发生信息相关的数据,作为 ECU 文档的一部分。

如果client定义的DTCMaskRecord 和DTCSnapshotRecordNumber参数的故障被识别,ECU应和DTC number、statusDTC 一起返回1个单独预定义的DTCSnapshotRecord来响应client的请求。

注意 2 :故障的准则应由系统供应商或整车厂定义

DTCSnapshot record可能包含多个可以用来重现故障发生时车辆状态(例如B+,RPM,时间戳)的data-parameters 。

整车厂应定义DTCSnapshotRecord的格式和内容。DTCSnapshotRecord报告的数据包含1个用来识别后续数据的dataIdentifier.这个dataIdentifier/data组合在DTCSnapshotRecord内部可能被重复。DTCSnapshotRecord内部1个或多个dataIdentifier的使用允许对1个DTC故障多次发生时存储不同类型的DTCSnapshotRecords.各DTCSnapshotRecord内指示record DataIdentifier数量的参数应和DTCSnapshotRecord一起提供来支持数据的检索。

ECU应在1个单独的响应信息中报告1个DTCSnapshot记录,除非client已将UserDefDTCSnapshotRecordNumber 设置为0xFF,因为这将导致ECU在1个单独的响应消息中响应client定义的DTCMaskRecord对应的ECU存储的所有DTCSnapshot record。DTCAndStatusRecord在响应消息中仅包含一次。如果client在请求中将DTCSnapshotRecordNumber参数已经设置为0xFF,ECU应按照数字升序报告某个DTC捕获的所有DTCSnapshot 记录。

当client定义的DTCMaskRecord或DTCSnapshotRecordNumber参数无效或ECU不支持时,ECU应给出负响应。当client定义的DTCMaskRecord和/或DTCSnapshotRecordNumber参数有效且被ECU支持,但是没有相关的DTCSnapshot数据(例如对于某个DTC或者record number,故障事件从未发生),ECU应给出仅包含DTCAndStatusRecord(echo of 请求的DTC number(high,middle,low byte)加上statusodDTC)正响应。
client成功发出 ClearDiagnosticInformation 请求后,应清除 DTCSnapshot 信息。 整车厂需要定义清楚删除已存储 DTC 和 DTCSnapshot 数据的规则以防内存溢出。

DTCMaskRecord

3字节的参数包含DTCHighByte, DTCMiddleByte 和 DTCLowByte,代表ECU支持的某个DTC独有的ID值。

该参数支持ECU从下方多种解码方式中选取1种:
— ISO 15031-6[17] specification. 该格式由 DTCFormatIdentifier = SAE_J2012-DA_DTCFormat_00定义
— 文档没有定义任何解码方式 ,支持整车厂自定义解码方式。该格式由 DTCFormatIdentifier = ISO_14229-1_DTCFormat定义。 
—  SAE J1939-73[24] specification. 该格式由 DTCFormatIdentifier = SAE_J1939-73_DTCFormat定义,
— ISO 11992-4[9] specification. 该格式由 DTCFormatIdentifier = ISO_11992-4_DTCFormat定义
— ISO 27145-2[21] specification. 该格式由 DTCFormatIdentifier = SAE_J2012-DA_VOBD_DTCFormat定义.
DTCMaskRecord 应包含单 DTC值. 禁止使用DTC组。

UserDefDTCSnapshotRecordNumber(client request)

该参数用于client请求SubFunction=reportDTCSnapshotByDTCNumber,该参数有1个字节,代表client请求的DTCMaskRecord对应的特定DTCSnapshot data record 数量。

0016和F016应作为法规(例如VOBD)相关内容进行保留。0116-EF16以及F116-FE16应供整成厂定义。FF16意为ECU应一次性报告所有存储的DTCSnapshot data record。

DTCRecord

该参数包含1组或多组 DTCHighByte, DTCMiddleByte和DTCLowByte. 此参数具体内容取决于DTCFormatIdentifier参数的值。

DTCFormatIdentifier

1个字节表示ECU报告的DTC格式按照哪个规范的定义。某个给定的ECU应仅支持1种DTC格式。
— SAE_J2012-DA_DTCFormat_00: This parameter value identifies the DTC format reported by the server as defined in ISO 15031-6[17] specification.
— ISO_14229-1_DTCFormat: This parameter value identifies the DTC format reported by the server as defined in this table by the parameter DTCAndStatusRecord.
— SAE_J1939-73_DTCFormat: This parameter value identifies the DTC format reported by the server as defined in SAE J1939-73[24].
— ISO_11992-4_DTCFormat: This parameter value identifies the DTC format reported by the server as defined in ISO 11992-4[9] specification.
— SAE_J2012-DA_DTCFormat_04: This parameter value identifies the DTC format reported by the server as defined in ISO 27145-2[21] specification.

DTCAndStatusRecord

该参数包含满足ISO_14229-1_DTCFormat, SAE_J2012-DA_DTCFormat_00, SAE_J1939-73_DTCFormat, SAE_J2012-DA_DTCFormat_04 或ISO_11992-4_DTCFormat格式的1组或多组DTCHighByte, DTCMiddleByte, DTCLowByte and statusOfDTC。如果满足SAE_J1939-73_DTCFormat,支持SPN (Suspect Parameter Number), FMI (Failure Mode Identifier), and OC (Occurrence Counter)参数,上述参数在SAE J1939有定义。

DTCHighByte, DTCMiddleByte 和 DTCLowByte代表了ECU支持的某个DTC的独有的ID。

UserDefDTCSnapshotRecordNumber(server response)

要么与client端请求中定义的UserDefDTCSnapshotRecordNumber参数相同,要么是ECU实际存储DTCSnapshot record的UserDefDTCSnapshotRecordNumber。

DTCSnapshotRecordNumberOfIdentifiers

1个字节参数,表示 the number of dataIdentifiers immediately following the DTCSnapshotRecord. 0016表示在DTCSnapshotRecord中有未定义的dataIdentifier的(例如DTCSnapshotRecord包含超过255个dataIdentifier)

DTCSnapshotRecord

系统故障发生时的快照数据值。

请求格式

响应格式

0x19 0x03举例

 假设

1.对于某个给定的DTC,ECU支持存储2个DTCSnapshot records;

2.ECU应表明对于DTC 123456,当前存储有2条DTCSnapshot records,DTC已发生3次(此时由于ECU内存不足,仅存储第一次和最后一次DTCSnapshot record)

3.ECU应表明DTC 789ABC,当前存储有1条DTCSnapshot record。

4.所有的DTCSnapshot records按照升序存储。

 0x19 0x04举例

假设

1.对于某个给定的DTC,ECU支持存储2个DTCSnapshot records;

2.ECU应表明对于DTC 123456,当前存储有2条DTCSnapshot records,DTC已发生3次(此时由于ECU内存不足,仅存储第一次和最后一次DTCSnapshot record),请求第2条DTCSnapshot record;

3.DTC 123456的 status bit是0x24,当DTC发生时,下方Table 353 环境数据被捕捉。

4.DTCSnapshot record数据通过dataIdentifier 0x4711查询。

 

 

### UDS Service 19-03 Protocol Specification and Implementation Details The UDS (Unified Diagnostic Services) service `19` is known as the "ReadDTCInformation" request, which allows reading diagnostic trouble codes from an ECU. The sub-function `03`, specifically within this context, refers to reporting DTC setting conditions by status mask[^1]. This means that when a client sends a message with SID (`Service Identifier`) set to `19` and SubFunction ID set to `03`, it requests information about specific types of faults based on their statuses. For implementing such functionality: #### Request Format A typical request would look like: ```c uint8_t req[] = {0x19, 0x03}; // Send via CAN or other supported protocols... ``` This command requires no additional parameters beyond specifying the desired status masks through subsequent bytes following the initial two-byte header containing the service identifier and subfunction code. #### Response Handling Upon receiving this request, ECUs will respond according to ISO 14229 standards, providing detailed records related to each active fault condition matching specified criteria. Each record typically includes: - A three-byte DID representing the type of data being reported. - One byte indicating how many groups follow. - For every group present, there are four parts per entry: - Status Mask Byte describing what kind of event occurred. - Failure Record Data Identifiers List Length Byte defining size. - Actual list of identifiers associated with failure events. - Snapshot Data Records Count Byte showing number available snapshots linked directly back to these failures. An example response might appear structured similarly below but note actual content varies depending upon vehicle manufacturer specifications and current system state at time query was made: ```plaintext [PositiveResponse] [SID=59][SubFuncRespCode=03] [DID_Byte1=DID_MSB][DID_Byte2=DID_LSB] [GroupCount=NumGroups] ... // Repeated Group Entries ... ``` --related questions-- 1. What does the UDS service 19-02 do? 2. How can one interpret different status bits returned under UDS service 19 responses? 3. In what scenarios should UDS services be utilized over proprietary diagnostic methods? 4. Can you provide examples where using physical versus functional addressing matters most during automotive diagnostics?
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值