节点文献

基于构件重构技术的PLC算法生成平台的研究与实现

The Research and Implementation on PLC Algorithm Generation Platform Based on Component Refactoring

【作者】 王婷

【导师】 包健;

【作者基本信息】 杭州电子科技大学 , 计算机应用技术, 2010, 硕士

【摘要】 可编程逻辑控制器作为现代工业控制四大支柱之一,在各种工业过程控制及各类机电一体化设备控制中得到极为广泛的应用。随着IEC61131-3标准的逐步推广和软硬件结合方式的普遍使用,PLC编程软件成为PLC开发过程中必不可少的部分。由于目前各个PLC制造商都配套拥有自己的设计平台,且其规范各不相同,工业控制相关人员需掌握各个不同软件的使用方法和控制程序设计标准,给设计过程带来不便,因此研究并实现一套界面友好、设计高效的通用PLC算法生成平台,具有较高的使用价值,并对PLC的发展具有重要的意义。本文在研究PLC算法生成平台设计相关技术的基础上,基于构件重构思想,设计并实现了PLC控制算法生成通用平台,该平台提供符合IEC61131-3标准的梯形图和指令表的设计功能,支持AVR、ARM7和ARM10E系列芯片。论文的主要工作及研究成果为:(1)在学习研究IEC61131-3国际标准和分析PLC编程工具及其发展状况的基础上,结合系统的需求分析,对PLC算法生成平台进行总体设计,将整个平台划分为用户界面层、梯形图算法解析层和数据通信层。用户界面层主要提供良好的控制算法设计环境,提高用户的设计效率;梯形图算法解析层负责将梯形图程序转化成可执行文件;数据通信层实现PLC与PC机之间数据的发送和接收。(2)为了提供操作便捷的控制算法设计环境,基于设计器框架实现梯形图程序编辑器。控制算法设计人员无需编程,通过拖放梯形图元素即可完成梯形图程序的布局。针对梯形图元素的设计,引入基于构件的软件开发方法,在研究分析该方法的理论、通用构件模型、嵌入式构件模型和构件组装后,提出梯形图构件模型及其组装方法,为梯形图转化为其他语言奠定了良好的基础。为了提高梯形图程序的设计效率,将构件重构思想应用到梯形图设计平台。将实现某个特定功能的梯形图程序封装成一个复合构件,经过验证后提供使用,可简化梯形图程序并保证其正确性。此外,梯形图编辑器还提供打印功能。(3)设计完成的梯形图程序将自动转化成IL指令,然后利用不同芯片所对应的编译器对其进行编译,生成可执行文件下载到PLC中。下载模式分正常模式和调试模式两种:正常模式下载完成后PLC中程序全速运行,平台只能查看或修改继电器状态和寄存器内容;调试模式下PC机还可发命令控制PLC中程序的运行情况。(4)利用该平台设计并实现三层电梯梯形图程序,通过实验比较传统设计方法和重构方法,结果表明使用该平台可有效提高梯形图设计效率,优化内存利用率,具有广泛的通用性和适应性。

【Abstract】 As one of the four pillars of modern industrial control, Programmable logic controller (PLC) is widely used both in various process control industry and mechatronics equipment. With widespread of IEC61131-3 standard and combination of software and hardware development method, PLC programming software has become an essential part of the development process. Different manufacturers of PLC only develop their own design platform, but their principles are not the same as each other. As the consequence of this phenomenon, related developers are required to master a large number of different usages and programming standards. But it introduces complexity and inconvenience to the design process. Thus, design and implement a plateform which is user-friendly and efficient for design has a great significance and marketing value.In this thesis, basic knowledge of PLC control algorithm platform is studied, and a PLC control algorithm generic platform based on component refactoring technology is designed and implemented. The platform provides design function for ladder diagram and instruction list which obey IEC61131-3 standard. AVR, ARM7, ARM10E and so on chips are supported. The work and research results can be summarized as following:(1) Based on learning PLC standard and analyzing the development of PLC programming tools, overall design for the platform is proposed to meet the system requirements. The whole platform is divided into three layers which are user interface layer, ladder diagram algorithm parse layer and data communication layer. The user interface layer provides an environment for control algorithm, which will improve the efficiency of design process. The ladder diagram algorithm parse layer is responsible for translating ladder diagram into an executable file. The data communication layer is designed for sending and receiving data between PLC and PC.(2) In order to provide easy-to-use control algorithm design environment, a ladder diagram editor is implemented based on design framwork. Control algorithm designers would design ladder diagram program layout by dragging and dropping elements without programming. Component-based software development (CBSD) methodology is introduced for designing ladder diagram. Based on analysis of theory of CBSD, common component model, embedded component model and component composition, ladder diagram component model and its assembly method are proposed. The proposed model and method are the good foundation for translating ladder diagram into other languages. In order to improve efficiency of ladder diagram program design, component refactoring method is applied to the ladder diagram design platform. Encapsulate a specific function ladder diagram into a composite component, validate and provide it to customer. This method will simplify design process and ensure ladder diagram’s correctness. In addition, ladder diagram editor also provides printing service.(3) The ladder diagram program will be automatically translated into IL instruction after design process. Then the IL instruction will be compiled to executable file by using different compiler according to different chips. Finally the executable file is loaded to the PLC. Two load modes are provided, regular mode and debug mode. Under regular mode, the PLC program keeps running and only the relay status and register can be watched and updated via platform. Under debug mode, PC can send commands to control PLC program running state.(4) Design and implement three-floor lift ladder diagram program by proposed platform. Comparing traditional design methods and component-based refactoring methods, the experimental results show that applying proposed platform can improve the design efficiency, and optimize memory utilization. The platform has a wide versatility and adaptability.

节点文献中: 

本文链接的文献网络图示:

本文的引文网络