基于构件重构技术的PLC算法生成平台的研究与实现
详细信息    本馆镜像全文|  推荐本文 |  |   获取CNKI官网全文
摘要
可编程逻辑控制器作为现代工业控制四大支柱之一,在各种工业过程控制及各类机电一体化设备控制中得到极为广泛的应用。随着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)利用该平台设计并实现三层电梯梯形图程序,通过实验比较传统设计方法和重构方法,结果表明使用该平台可有效提高梯形图设计效率,优化内存利用率,具有广泛的通用性和适应性。
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.
引文
[1]程立英,野莹莹,彭泽波. PLC教程原理·应用·设计[M].北京:人民邮电出版社, 2009.
    [2]徐德,孙同景.可编程控制器(PLC)应用技术[M].山东:山东科学技术出版社, 2001.
    [3]徐世许.可编程序控制器原理·应用·网络[M].中国科学技术大学出版社, 2000.
    [4]John K H, Tiegelkamp M. IEC 61131-3 International Standard, Programmable controllers[M]. Part 3: Programming Languages, 2003.
    [5]彭瑜.工控编程语言IEC61131-3的现状与发展[J].国内外机电一体化技术, 2004, 7(1): 42-49.
    [6]宫淑贞,徐世许.可编程控制器原理及应用[M].北京:人民邮电出版社, 2009.
    [7]宋德玉.可编程序控制器原理及应用系统设计技术[M],北京冶金工业出版社. 1999.
    [8]赵燕,周新建.可编程控制器原理与应用[M].北京:中国林业出版社、北京大学出版社, 1998.
    [9]皮壮行,宫振鸣,李雪华.可编程序控制器的系统设计与应用实例[M],机械工业出版社. 2000.
    [10]MITSUBISHI.FX1S FX1N FX2N FX2NC Programming Manual[M].2000.
    [11]SIEMENS COMPANY.SIMATIC S7-200 PLC System Manual[M].2000.
    [12]OMRON COMPANY.OMRONC200HX/C200HG/C200HE Programming Manual[M].2002
    [13]ICS triplex. ISaGRAF[EB/OL].Available at: http://www.isagraf.com/.
    [14]Mili H, Mili F, Mili A. Reusing Software: Issues and Research Directions[J]. IEEE Transactions on Software Engineering, 1995, 21(6): 528-562.
    [15]杨芙清,梅宏,李克勤.软件复用和软件构件技术[J].电子学报, 1999, 27(2):68-75.
    [16]周欣,陈向葵,孙家骕,杨芙清.面向对象系统中基于度量的可复用构件获取机制[J].电子学报, 2003, 31(5): 649-653.
    [17]Emmerich Wolfgang, Kaveh Nima. Component technologies: Java Beans, COM, CORBA, RMI, EJB and the CORBA component model[C]. Proceedings of the ACM SIGSOFT Symposium on the Foundations of Software Engineering, 2001, 311-312.
    [18]钟林辉,谢冰.扩充CDL支持基于构件的系统组装与演化[J].计算机研究与发展, 2002, 39(10): 1361-1365.
    [19]NEC Sol, rare Engineering Laboratory.NATO standard for management of a reusable software component libmry[J].NATO Communicatiom andInformation SystemsAgency, 1991, 2: 32--43.
    [20] Morel JM, Faget J.The REBOOT Environmen[tJ].Proceedings of the 2nd International Workshop on Software Reusability Advances in Software.Lucca:IEEE Computer Society Press,1993, 80-88.
    [21]Don Box, ESSENTIAL COM[M].Addison-Wesley Professional, 1998.
    [22]Suhail Ahmed.CORBA Programming Unleashed[M].Sams Publishing, 1998.
    [23]Bill Burke, Richard Monson-Haefel.Enterprise JavaBeans 3.0 (5th Edition) [M].O'Reilly Media, Inc, 2006.
    [24]H Jubin, J Friedrichs. Enterprise JavaBeans by Example[M]. Prentice Hall, New Jersey, 2000.
    [25]Rob van Ommering, Frank van der Linden, Jeff Kramer et al. The Koala Component Model forConsumer Electronics Software[J]. IEEE Computer, 2000, 33(3): 78-85.
    [26]M.Winter, T.Genbler, A.Christoph, et al. Components for embedded software-The PECOS approach[C]. In Proc. Second International Workshop on Composition Languages, 2002.
    [27]科泰世纪公司.《和欣1. 1》资料大全[EB/OL][2003-10/2004-9]. http://www.koretide.com.cn.
    [28]科银京成公司.“道系统”技术白皮书[EB/OL][2003]. http://www.coretek.com.cn.
    [29]Ivica Crnkovic, Magnus Larsson. Building Reliable Component-based Software Systems[M]. Boston, London: Artech House, 2002.
    [30]房红征,赵贵根,柳克俊.嵌入式组件模型研究[J].微计算机应用, 2005, 26(5): 521-524.
    [31]D.Isovic, C.Norstrom. Components in real-time system[C]. In Proc.RTCSA 2002, 8th International Conference on Real Time Computing Systems and Applications, 2002.
    [32]Hans Hansson, Mikael ?kerholm, Ivica Crnkovic. SaveCCM: A Component Model for Safety-Critical Real-Time Systems[C]. 30th EUROMICRO Conference, 2004, 30: 627-635.
    [33]G6ssler G,Sifakis J.Composition for component-based modeling[J].Science of Computer Programming,2005,55(1-3): l61-183.
    [34]张世琨,张文娟,常欣,王立福,杨芙清.基于软件体系结构的可复用构件制作和组装[J].软件学报, 2000, 12(9): 1351-1359.
    [35]Clemens Szyperski, Dominik Gruntz, Stephan Mure,王千祥等译.构件化软件:超越面向对象编程(第二版)[M].北京:电子工业出版社, 2004.
    [36]Kim In-Gyu, Bae Doo-Hwan, Hong Jang-Eui. A component composition model providing dynamic, flexible, and hierarchical composition of components for supporting software evolution[J]. Journal of Systems and Software, 2007, 80(11):1797-1816.
    [37]Kung-Kiu Lau, Ling Ling, Zheng Wang. Composing Components in Design Phase using Exogenous Connectors[C]. 32nd Euromicro Conference on Software Engineering and Advanced Applications, SEAA, 2006, 12-19.
    [38]贾育.基于演化计算构件的软件复用方法[D].北京:中国科学院研究生院, 2002.
    [39]李刚,金茂忠.一种可重用构件的设计方法[J].计算机研究与发展, 2000, 37(5): 609-615.
    [40]杨芙清,梅宏,李克勤.软件复用与软件构件技术[J].电子学报, 1999, 27(2): 68-75.
    [41]王志坚,费玉奎,娄渊清.软件构件技术及其应用[M].北京:科学出版社, 2005.
    [42]Edouard Tisserant, Laurent Bessard, Mário de Sousa. An Open Source IEC 61131-3 Integrated Development Environment[C]. 5th IEEE International Conference on Industrial Informatics (INDIN), 2007, 1: p183-187.
    [43]Lucien Ngalamou, Leary Myers. An Industrial Process Control Studio (IPCS) Development Tool: The IEC 61131-3 Model Capture Features[C]. 2006 SICE-ICASE International Joint Conference, 2006, 2874-2878.
    [44]吴宁,葛芬.可编程逻辑控制器通用开发平台的设计与实现[J].仪器仪表学报, 2007, 28(8): 1486-1491.
    [45]Feihu Hu, Liang Fu, Le Liu, Guanqun Zhang. A soft PLC ladder diagram edit software implemented based on table technology[C]. 2008 Pacific-Asia Workshop on Computational Intelligence andIndustrial Application, PACIIA 2008, 2008, 1: 817-821.
    [46]Richter J. Microsoft. .NET框架程序设计[M].北京:清华大学出版社, 2003.
    [47]许文波,华奇兵等.面向对象的软件重构[J].计算机工程.2005
    [48]王忠杰,徐晓飞,战德臣.面向复用成本优化的构件重构方法[J].软件学报, 2005, 16(12): 2157-2165.
    [49]邓勇,桑楠,罗克露,高卓.智能家电嵌入式软件的源码构件设计方法[J].计算机工程, 2007, 33(6): 280-282.
    [50]Vitharana P, Jain H, Zahedi FM. Strategy-Based design of reusable business components[J]. IEEE Trans. on Systems, Man, and Cybernetics-Part C: Applications and Reviews, 2004, 34(4): 460?474.
    [51]France R, Ghosh S, Song E, Kim DK. A metamodeling approach to pattern-based model refactoring[J]. IEEE Software, 2003, 20(5):52?58.
    [52]Yan Yi, Zhang Hangping. A New Translation Algorithm from Ladder Diagrams to Instruction List[C]. IFAC Proceedings Volumes (IFAC-PapersOnline), 2008, 17(1).
    [53]Eric Freeman, Oreily Taiwan公司译. Head First设计模式[M].中国电力出版社, 2007.
    [54]Erich Gramma, Richard Helm, Ralph Jphnson, John Nlissides.李英军,马晓星,蔡敏等译.设计模式(可复用面向对象软件的基础)[M].机械工业出版社, 2004.

© 2004-2018 中国地质图书馆版权所有 京ICP备05064691号 京公网安备11010802017129号

地址:北京市海淀区学院路29号 邮编:100083

电话:办公室:(+86 10)66554848;文献借阅、咨询服务、科技查新:66554700