Understanding UDS Diagnostics: Essence and Detailed Explanation

Looking Beyond the Phenomenon to the Essence

Functional Signal
Signal communication is a basic function of the vehicle ECU; without it, nothing can be discussed!
This can be plainly stated as dbc and HIL, which are the starting points of ECU’s basic capabilities~
Bus 10[2] discusses the release of excel2dbc tool 2.0.2, adding signal groups
Diagnostic Protocol
UDS diagnostics is an advanced function of the vehicle ECU, where the basic mode is “question and answer,” and it can also facilitate big data conversations.
For knowledge related to UDS protocol, you can search on Zhihu; there is a lot of content available, although the quality varies, but there are also some good quality materials worth checking out.
UDS can do many things, such as reading and writing fault codes, writing configurations, flashing programs, etc.
In today’s automotive industry, it is a very useful and crucial function.
Bus 26[2] discusses offline automatic parsing of diagnostic messages in BLF format
Bus 23 discusses the development of a PC-based diagnostic tool
Bus 4 discusses UDS service testing 1
Bus 12 discusses an open-source BT host computer based on the UDS protocol stack
Bus 56 discusses UDS protocol testing, providing a complete detailed explanation

UDS Players on Stage

Understanding UDS Diagnostics: Essence and Detailed Explanation

Most bus device manufacturers at home and abroad have their own UDS solutions, but the implementation methods vary.

The strongest among them is undoubtedly Vector, the global leader in the industry, which we won’t elaborate on.

In addition, Guangzhou Hongke’s PCAN also provides its own UDS solution, which is a non-open-source UDS.dll packaged for a large number of domestic users, allowing users to conduct secondary development for host computers.

Kvaser’s solution focuses on hardware, with software development left to users, but Shizi No. 1 believes that this approach will become increasingly narrow in the future, as the real value lies in software, which has a higher added value.

Zhou Ligung has also added UDS functionality modules to his ZCANpro, which is quite convenient to use, making it the first original manufacturer in the field of UDS protocol stack in China.

Understanding UDS Diagnostics: Essence and Detailed Explanation

Of course, if we talk about the current strongest domestic player in UDS protocol, it must be the rising star TSMaster, which needs no further introduction.

The pride of domestic products, TSMaster, brings us captivating UDS diagnostic functions.

Detailed explanation of the CAN bootloader solution and source code based on TSMaster.

UDS diagnostics is a high-value function, so whether it’s TSMaster, ZCANpro, CANoe, or PCAN’s UDS.dll, they only support their own hardware devices, which is a reasonable business logic.

Looking Beyond the Phenomenon to the Essence

Understanding UDS Diagnostics: Essence and Detailed Explanation

Let’s analyze from a technical perspective what UDS really is?

Answer: The diagnostic tool requests, and the ECU responds; it’s that simple!

Understanding UDS Diagnostics: Essence and Detailed Explanation

Let’s break down this “question and answer” process into “questions” and “answers.”

“Question” process can be multi-frame or single-frame.

Single-frame is straightforward, so we won’t elaborate on it.

For multi-frame, the ECU needs to respond with a 30 flow control, and then the host computer sends the remaining content, and finally, the ECU needs to reply with a confirmation to indicate it has received the host computer’s request.

The “question” process is that simple!

“Answer” process can also be single-frame or multi-frame.

Single-frame is also straightforward, so we won’t elaborate on it.

For multi-frame, the host computer first responds with a 30 flow control, and then the ECU sends out the remaining information, and once done, the host computer does not need to reply with confirmation.

Thus, essentially, the essence of UDS is a function, a “request-response” function, where both requests and responses can be single-frame or multi-frame.

Functions similar to the following:

function diagnose(requestId, responseId, requestData, addressingType, requirePositiveResponse, dataValidation){  requestId //  responseId //  requestData // u8 data, array type, compatible with multi-frame  addressingType // 0: physical addressing, 1: functional addressing  requirePositiveResponse // 0: require positive response 1: suppress positive response  dataValidation // struct array, struct contains 2 elements,          // element 1: index of response data array; element 2: expected value of that index  p2 and p2Server use defaults    return true or false}

This is the essence of UDS diagnostics, which has become widely popular in the industry and is truly very simple!

The return value is just a boolean, either true or false!

Everything you see in the diagnostic field, reading faults, writing parameters, writing configurations, flashing programs, writing VINs, unlocking, switching modes, memory verification, communication control, etc., all comes from such a function.

Taking bootloader flashing as an example, all its steps are implemented using such a function.

Based on this function, you can create very advanced UDS applications; all tasks in the diagnostic field are not a problem.

Vehicle technology has packaged this function into LabVIEW source code, included in the “Vehicle Technology LabVIEW Video” tutorial for your reference, welcome to use.

For more details, you can scan the QR code in the image below:

Understanding UDS Diagnostics: Essence and Detailed Explanation

At the bottom layer of this source code, there is also a function node calling the CAN box, which is also completely open-source. If you know how to use LabVIEW to call any ordinary CAN card, you can definitely do some work on this function node to satisfy your broad imagination.

This matter cannot be stated too plainly; those who understand will understand~

[Recommendation]
In the automotive industry, never engage in outsourcing
Hengrun and Yiang, two windows to understand the past, present, and future of the industry

Bus 10 discusses the best excel2dbc tool in the eastern hemisphere, always free to give away

Understanding UDS Diagnostics: Essence and Detailed Explanation

Understanding UDS Diagnostics: Essence and Detailed Explanation

Understanding UDS Diagnostics: Essence and Detailed Explanation

Understanding UDS Diagnostics: Essence and Detailed Explanation

Leave a Comment