Abstract: This paper introduces the design method of a diesel engine test system based on CAN fieldbus, elaborates on the hardware and software structure of the control system, provides a detailed system block diagram, and discusses in detail the hardware design of the lower-level fieldbus intelligent node and the system software. Keywords: Fieldbus, Engine Test 1 Introduction Diesel engine test is the last critical process in diesel engine production, playing a vital role in the quality of diesel engine manufacturing. Its main content is to determine the pass/fail status of the diesel engine by recording and analyzing the process parameters under specific test conditions, and to promptly identify and eliminate faults. Many currently used diesel engine test platforms analyze and judge the working status of a diesel engine during test through instrument readings, which is not only inefficient and inaccurate, but also has limited comprehensive analysis and judgment capabilities. In order to gain a more comprehensive and intuitive understanding of the diesel engine test process, quickly identify and eliminate potential faults, and improve the analytical judgment capabilities of test operators, we developed a diesel engine test system based on CAN fieldbus in conjunction with enterprise technological transformation, realizing the simultaneous monitoring and testing of multiple diesel engines during test. 2 Test System Structure Composition According to the test requirements of diesel engines, this system mainly completes the processing of various sensor signals and the acquisition of diesel engine operating condition data during the test of diesel engines, and sends the data to the host computer through the CAN bus. It is required to process 16 analog signals and 16 I/O signals. The parameters collected mainly include: oil pressure and temperature, coolant temperature, intake and exhaust temperature, fuel level, starting battery voltage, speed, etc. Figure 1 Block diagram of diesel engine test system based on CAN bus The key to the diesel engine test system is the introduction of CAN bus technology to form a distributed measurement and control system model based on CAN bus, as shown in Figure 1. Since CAN bus is one of the types of fieldbus, it belongs to the open low-level control network. It is a system applied to the production site to realize bidirectional serial multi-node digital communication between microcomputer measurement and control equipment. Therefore, the distributed measurement and control system based on CAN bus is open, rather than closed and dedicated [1]. This test system distributes the monitoring function to each test bench, and each test bench is monitored by a CAN intelligent node. Each CAN bus node has the same composition, including: a main control unit, a CAN bus communication management unit, and a data acquisition and processing unit. Each node is connected to the host computer via the CAN bus, enabling communication between them. 3. Test System Hardware Design The diesel engine test system adopts a two-level distributed structure. The host computer is a PC, with a PC-CAN bus adapter card installed in its PCI bus slot. This allows the host and slave computers to be connected via the CAN bus to form a control network. The slave controller uses an intelligent node composed of an AT89C51 microcontroller and an SJA1000 CAN bus controller. These directly control various field devices (such as sensors, relays, motors, etc.), collect field data, and send data to the CAN bus based on received commands or by actively sending data. By pre-setting acceptance codes and acceptance mask codes, the intelligent nodes can control which data or commands they receive from the bus. If certain data requires further complex processing (such as dynamic display), the host computer can receive data from the bus. When the host computer needs to apply control actions to a specific node, it can communicate with that node in a point-to-point manner. When it needs to apply control actions to all nodes simultaneously, it can broadcast the commands to the bus. This way, the system can operate normally without the host computer's involvement, significantly reducing data transmission volume and improving the system's real-time performance and reliability. The hardware design of the diesel engine test system mainly involves the PC-CAN adapter card in the host computer and the CAN intelligent node in the lower-level computer. This section focuses on analyzing the structural composition of the CAN intelligent node. Figure 2 shows the circuit diagram of the CAN bus intelligent node on the diesel engine test bench. In the CAN intelligent node shown in Figure 2, the core components are the CAN bus controller SJA1000, the CAN bus driver 82C250, and the microcontroller AT89C51. The AT89C51 has two main tasks: first, it is responsible for initializing the CAN controller SJA1000 and controlling the SJA1000 to achieve data reception and transmission; second, it is responsible for acquiring field signals and controlling field equipment. SJA1000 is a CAN controller from Philips. It implements the data link layer and physical layer functions in the CAN bus network. By programming it, the microprocessor can set its working mode, control its working state, send and receive data, and build the application layer on its basis [2]. In this design, in order to enhance the anti-interference capability of the CAN bus node, the CAN bus interface with opto-isolation of SJA1000 is adopted. The transmit output terminal TX0 and the receive input terminals RX0 and RX1 of SJA1000 are isolated by the high-speed integrated optocoupler 6N137 and then connected to the TXD and RXD of the CAN bus interface driver chip 82C250. The 82C250 is directly connected to the CAN physical bus. 4 Test system software architecture Figure 3 Schematic diagram of the software structure of the diesel engine test system 4.1 Upper computer monitoring software The upper computer monitoring software is developed using configuration software. As a software platform tool with customizable functions, configuration software has developed with the increasing maturity of distributed control systems and computer control technology. Currently, with the gradual promotion of fieldbus technology, fieldbus and open systems have become the external environment upon which configuration software relies for its growth. This makes it easier for configuration software to connect with numerous input/output devices, thereby promoting the application of configuration software in fieldbus control systems. Through a comparison of the performance and price of existing configuration software, and considering the actual needs of this technical upgrade project, the domestically produced "Century Star" configuration software was selected to develop the monitoring program for the CAN bus system. To organically combine the upper-level human-machine interface program with the lower-level data acquisition and exchange program, we divided the monitoring program into two parts: applying a server-client structure to the configuration software design of the CAN bus control system, implementing the human-machine interface program as the client-side program and the program that exchanges data with the hardware as the server-side program. 4.2 Lower-level communication software: Each diesel engine test bench acts as an intelligent node on the CAN bus, transmitting information such as the detection status and control results of each test bench to the upper-level computer through the CAN communication interface, and is ready to receive control commands from the upper-level computer at any time. The lower-level control program adopts modular programming, including a CAN bus communication management module, a diesel engine operating status monitoring module, an A/D inspection sampling and data transfer module, and an I/O switch signal processing module. Among these, the CAN node communication module is crucial, as it determines the normal operation of the entire distributed control network. The CAN node communication module consists of a CAN initialization subroutine, a CAN interrupt program, and a CAN data transmission and reception subroutine, as shown in Figure 4. Figure 4: Flowchart of CAN Node Communication Control on the Test Stand 5. Conclusion The research content of this paper has been tested and runs well on the test stand of a domestically produced 135 series diesel engine. Practice shows that the CAN bus-based distributed testing system is stable and reliable, with advantages such as flexible and simple configuration, low cost, high reliability, strong anti-interference ability, and good expandability. It can comprehensively monitor the diesel engine test process, greatly reducing test time, improving monitoring working conditions, enhancing the scientific management of equipment, and enabling early detection of certain faults, preventing losses caused by delayed handling.