Based on MATLAB/Simulink, the ECU application software components library for diesel engine has been designed in this paper. The hierarchic and modularized components library is an open research platform for the model-based control software development. Using the components technology, the requirements of the diesel engine ECU application software have been analyzed, upon which the detailed components partition and the components library design have been accomplished. Besides, based on this components library, a control prototype for the diesel engine has been established quickly and verified through the Hardware-in-the-Loop test. The ECU software design and test process based on the components library show a good flexibility of the library, and it can improve the configurability and reusability of the software and increase the efficiency of the control software development.