| With the development of electronic technology, electronic control unit (ECU) costs more and more in vehicle production, which changes the traditional way of vehicle inspection and test. Decoders communicate with electronic control unit to obtain relevant data in order to realize the diagnosis of car. Based on communication protocol KWP2000 and CANBUS, the paper develops a software of auto diagnosis with C programming language, in order to realize the diagnosis of different brand cars using one device, which could decrease the cost of car diagnosis.Firstly, system architecture of universal diagnostic instrument and software development environment are presented. According to a general-purpose diagnostic instrument which equips with the basic diagnostic work, some software development content and development tools are introduced..Secondly, the software development process is described in detail.We choosed the currently wide used automotive communication protocols--CANBUS and KWP2000,and learned it’s frame format and the key commands, the ECU simulation file was generated by software tools based on auto sample files, protocol file was generated by using the original standard protocol. Because the XML (Extensible Markup Language) is simple and easy to upgrade, it was used to build a database to store various parameters associated with the diagnostic including initialization parameters, ECU version information, fault code, and data flow entries, etc. We used C language to develop XML parser. All types of commands from the XML database were parsed and then provided to the C program, we developed C language diagnostic program on Visual Studio 2012 platform, and combined with the corresponding XML database to achieve the overall diagnostic function.With the problems encountered in the process of development,1 described these troubles and the methods to figure out them in detail. It is the main point in the process. The more problems are solved, the more software architecture and comprehension of C 1 could grasp, and thus 1 could improve my ability to analyze and solve these issues.At last, the all problems was sent back to my program. The functions of device was completed further, and it was found that the car diagnostic functions can run correctly in the process of car fault diagnosis. |