Looking Beyond the Phenomenon to the Essence |
UDS Players on Stage
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.
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
Let’s analyze from a technical perspective what UDS really is?
Answer: The diagnostic tool requests, and the ECU responds; it’s that simple!
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:
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~
Bus 10 discusses the best excel2dbc tool in the eastern hemisphere, always free to give away