With the fast development and widely application of numerical control technology, the needs of staff training increased more quickly. To design a simulate NC software with high-effect emulation is just a method of enhancing security, economic and efficiency for demonstrating and staff training.Visual C++ 6.0 is used as a software development platform and the object-oriented method is used to analyze and design NC machining simulation system overall in this paper. Base on these, a modular design method is proposed. It makes the NC lathe simulation process divided into four sub-modules: operation panel, machining simulation environment, machining simulation process and simulation result examination, then completes each sub-module design separately, finally links up each sub-module to form a complete system. According to this thought, the paper explores the processing environment modeling method, NC program decoding process, interpolation method, the forming principle and process of the workpiece etc. The OpenGL technology is also used in the paper. By dint of the powerful 3D graphics programming functions provided by the OpenGL and the object-oriented modeling method, a process simulation environment can be set up.In order to get more real simulation environment, we make a real operation panel. A flexible panel adapter for CNC machine based on AT89C51 MCU is presented. The hardware and software of this adapter are described. The paper also gives the figure of structural principle of asynchronous serial port keyboard and the flow chart of soft ware. This adapter is interfaced with CNC systems via standard RS232 serial port. In this paper, it also introduces how to realize the serial communication based on MSComm of VC++6.0.This system has such characteristics as friendly interface, simple manipulation, good portability and expansion, thus accord with the latest development direction of NC technique. |