| Programmable process controller is called PC or PLC for short, it is developed from the Electrical control technology and computer technology, gradually developed into one of the new industrial control device on which the microprocessor is as the core, and melted with automation technology, computer technology and communication technology together. Because it is essily setted and conveniently programmed, operation can be estimated, even it can still maintain normal operation in bad working conditions, so it has been widely used in various industrial control areas.This topic designs a miniature programmable controller based on ADuC831microcomputer, which is on the basic of depply analysis and research of the traditional structure of PLC, working principle and combining with the characteristics of the single-chip microcomputer control system. It aims to use miniature PLC system programming language to realize the conventional microcontroller module industral application and configuration, so as to constitute a cheap and convenient operation of the application system, to get rid of microcomputer application programming bottleneck, to make it have a good application prospect in the field of industrial control.This design mainly contains two parts of hardware and software design. In the hardware design, the lower computer is developed with ADuC831microcontroller as the core, the hardware circuit is designed by using modular design method, mainly including single chip minimize system, digital input/output module, analogue input/output module, communication module and the clock and display module five parts; At the same time in the hardware design, it is strictly followed the anti-interference design principle, to ensure that the system has good anti-interference stabile characteristics. In software design, in order to make the controller can perform PLC instructions and in analysis and research commonly used instructions and characteristics of the PLC instructions, we firstly designs binary code table which is corresponding to the operation codes and operands of PLC instructions, then through the reference on function and characteristic of the mainstream small PLC on the market at present, We respectively Design the upper and lower computer software.The function of the PC software is mainly to convert PLC program into the binary program code that can be recognized and executed by single chip microcomputer easily. The software’s programming implementation is through VB6.0in Windows environment, the design mainly includes PLC instructions’s process of text files, realization of instruction code conversion, the setting of the lower computer’s clock with a key, sending data to the lower computer through the serial por and receiving and processing data received five parts. The communication between the upper compuer and the lower computer uses Modbus communication protocol and implements information exchange through the serial communication interface. In addition, the remote communication interface for the cascade of PLC is added, which provides the hardware and software foundation for future functional expansion to be a strong PLC system.The function of the lower computer software is to simulate operating principle of PLC, to complete input processing, to execut the object code and to output processing, etc. In this design, the lower computer software develops through assembly language and realizes programming through the Keil software, and mainly includes serial communication, digital clock display, reading and writing data processing and interpretation execute user data, system transformation and check code calculations, etc.The design of the programmable controller based on ADuC831microcompute adapts to the modern industrial controller’s development tendency to low cost and high performance, provides a more flexible and conveniently extended scheme of software and hardware, and greatly reduces the cost of the control system, also has a high practical value. |