Please wait a minute...
 首页  期刊介绍 期刊订阅 联系我们 横山亮次奖 百年刊庆
 
最新录用  |  预出版  |  当期目录  |  过刊浏览  |  阅读排行  |  下载排行  |  引用排行  |  横山亮次奖  |  百年刊庆
清华大学学报(自然科学版)  2021, Vol. 61 Issue (10): 1159-1165    DOI: 10.16511/j.cnki.qhdxxb.2021.22.012
  自动化 本期目录 | 过刊浏览 | 高级检索 |
PLC指令表程序的一种语法分析方法及其在代码静态测试上的应用
李学良, 赵千川, 杨文, Syed Naeem HAIDER
清华大学 自动化系, 北京信息科学与技术国家研究中心, 智能与网络化系统研究中心, 北京 100084
A syntax analysis method of PLC instruction list program and its application in static testing
LI Xueliang, ZHAO Qianchuan, YANG Wen, Syed Naeem HAIDER
Center for Intelligent and Networked Systems, Beijing National Research Center for Information Science and Technology, Department of Automation, Tsinghua University, Beijing 100084, China
全文: PDF(1348 KB)   HTML
输出: BibTeX | EndNote (RIS)      
摘要 可编程逻辑控制器(PLC)是工业控制领域中广泛使用的自动控制装置。由于PLC程序缺乏具有普适性的测试工具,开发人员往往只能采用人工方式排查代码错误,导致测试效率低下。工业用户亟需一种标准化PLC代码检测方法,自动完成PLC程序语法检测与分析。该文以IEC61131-3标准为基础,建立基于Backus-Naur范式(BNF)的指令表语法模型。基于该模型构造抽象语法树,进而设计出一种具有线性复杂度的PLC指令表代码语法检测算法。利用2段控制工程中的PLC指令表代码对所提出的算法与商用软件CODESYS Static Analysis进行对比测试,验证了所提算法的可用性。
服务
把本文推荐给朋友
加入引用管理器
E-mail Alert
RSS
作者相关文章
李学良
赵千川
杨文
Syed Naeem HAIDER
关键词 可编程逻辑控制器(PLC)指令表(IL)静态分析IEC61131-3    
Abstract:Programmable logic controllers (PLC) are automatic controllers widely used for industrial control. Because PLC program testing is lack of general testing tools, developers can only manually check code syntax errors, which is inefficient. Thus, industrial users need a standardized PLC code testing method to automatically complete the PLC program syntax detection and analysis. This paper presents an instruction list syntax model based on the Backus-Naur form (BNF) and the IEC61131-3 standard for industrial users. A PLC code syntax fault detection algorithm with linear complexity is then built with an abstract syntax tree to automatically check the PLC code syntax. Compared wich the CODESYS Static Analysis, analysis of two industrial PLC programs demonstrates the usability of this PLC code static analysis method.
Key wordsprogrammable logic controller (PLC)    instruction list (IL)    static analysis    IEC61131-3
收稿日期: 2020-12-16      出版日期: 2021-08-26
基金资助:国家重点研发计划项目(2017YFC0704100,2016YFB0901900);国家自然科学基金项目(61425027);高等学校学科创新引智计划资助项目(BP2018006);北京信息科学与技术国家研究中心项目(BNR2019TD01009);国家高速列车技术创新中心研发项目(CX/KJ-2020-0006)
通讯作者: 赵千川,教授,E-mail:zhaoqc@tsinghua.edu.cn     E-mail: zhaoqc@tsinghua.edu.cn
引用本文:   
李学良, 赵千川, 杨文, Syed Naeem HAIDER. PLC指令表程序的一种语法分析方法及其在代码静态测试上的应用[J]. 清华大学学报(自然科学版), 2021, 61(10): 1159-1165.
LI Xueliang, ZHAO Qianchuan, YANG Wen, Syed Naeem HAIDER. A syntax analysis method of PLC instruction list program and its application in static testing. Journal of Tsinghua University(Science and Technology), 2021, 61(10): 1159-1165.
链接本文:  
http://jst.tsinghuajournals.com/CN/10.16511/j.cnki.qhdxxb.2021.22.012  或          http://jst.tsinghuajournals.com/CN/Y2021/V61/I10/1159
  
  
  
  
  
  
  
  
  
  
  
  
  
  
[1] 赵千川, 王达, 薛文轩. PLC程序测试与验证的研究进展[J]. 清华大学学报(自然科学版), 2011, 51(11):1617-1623. ZHAO Q C, WANG D, XUE W X. Testing and validation of programmable logic controller programs[J]. Journal of Tsinghua University (Science and Technology), 2011, 51(11):1617-1623. (in Chinese)
[2] 徐啸天. 一种PLC程序静态缺陷检测工具的设计与实现[D]. 南京:南京大学, 2017. XU X T. Design and implementation of a static bug detection tool for PLC program[D]. Nanjing:Nanjing University, 2017. (in Chinese)
[3] 王达. 一类工业控制软件测试与验证的几个关键问题研究[D]. 北京:清华大学, 2011.WANG D. Research on key issues of test and validation in some industrial control software[D]. Beijing:Tsinghua University, 2011. (in Chinese)
[4] HUNG M Y, CHEN P S, HWANG Y S, et al. Support of probabilistic pointer analysis in the SSA form[J]. IEEE Transactions on Parallel and Distributed Systems, 2012, 23(12):2366-2379.
[5] BOUGOUFFA S, DONG Q H, DIEHM S, et al. Technical debt indication in PLC code for automated production systems:Introducing a domain specific static code analysis tool[C]//Proceedings of the 3rd IFAC Conference on Embedded Systems, Computational Intelligence and Telematics in Control, CESCIT 2018. Faro, Portugal, 2018:70-75.
[6] International Electrotechnical Commission. Programmable controllers-part 3:Programming languages:IEC 61131-3[S]. Genève, Switzerland:International Electrotechnical Commission, 2003.
[7] PRÄHOFER H, ANGERER F, RAMLER R, et al. Static code analysis of IEC 61131-3 programs:Comprehensive tool support and experiences from large-scale industrial application[J]. IEEE Transactions on Industrial Informatics, 2017, 13(1):37-47.
[8] HOFER F, RUSSO B. IEC 61131-3 software testing:A portable solution for native applications[J]. IEEE Transactions on Industrial Informatics, 2020, 16(6):3942-3951.
[9] JAMRO M. POU-oriented unit testing of IEC 61131-3 control software[J]. IEEE Transactions on Industrial Informatics, 2015, 11(5):1119-1129.
[10] 王炜新, 周凯, 毛飞龙. 基于AOV和广义表的梯形图转指令表的转换算法[J]. 清华大学学报(自然科学版), 2019, 59(12):1039-1044. WANG W X, ZHOU K, MAO F L. Transformation algorithm from a ladder diagram to an instruction list based on AOV and Lists[J]. Journal of Tsinghua University (Science and Technology), 2019, 59(12):1039-1044. (in Chinese)
[11] 彭瑜, 何衍庆. IEC 61131-3编程语言及应用基础[M]. 北京:机械工业出版社, 2009. PENG Y, HE Y Q. Fundamentals of IEC 61131-3 programming language and application[M]. Beijing:China Machine Press, 2009. (in Chinese)
[12] GRIMMER A, ANGERER F, PRÄHOFER H, et al. Supporting program analysis for non-mainstream languages:Experiences and lessons learned[C]//Proceedings of 2016 IEEE 23rd International Conference on Software Analysis, Evolution, and Reengineering. Suita, Japan, 2016:460-469.
[13] 高传平, 谈利群, 宫云战. 基于抽象语法树的代码静态自动测试方法研究[J]. 北京化工大学学报, 2007, 34(S1):25-29. GAO C P, TAN L Q, GONG Y Z. Research on the syntax tree-based method for static and automated code testing[J]. Journal of Beijing University of Chemical Technology, 2007, 34(S1):25-29. (in Chinese)
[14] BIALLAS S, FRIEDRICH N, SIMON H, et al. Automatic error cause localization of faulty PLC programs[C]//Proceedings of the 5th IFAC International Workshop on Dependable Control of Discrete Systems:DCDS 2015. Cancun, Mexico, 2015:79-84.
[15] DUSCHL K C, GRAMß D, OBERMEIER M, et al. Towards a taxonomy of errors in PLC programming[J]. Cognition, Technology & Work, 2015, 17(3):417-430.
[1] 韩心慧, 魏爽, 叶佳奕, 张超, 叶志远. 二进制程序中的use-after-free漏洞检测技术[J]. 清华大学学报(自然科学版), 2017, 57(10): 1022-1029.
[2] 韩心慧, 丁怡婧, 王东祺, 黎桐辛, 叶志远. Android恶意广告威胁分析与检测技术[J]. 清华大学学报(自然科学版), 2016, 56(5): 468-477.
[3] 董国伟, 王眉林, 邵帅, 朱龙华. 基于特征匹配的Android应用漏洞分析框架[J]. 清华大学学报(自然科学版), 2016, 56(5): 461-467.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
版权所有 © 《清华大学学报(自然科学版)》编辑部
本系统由北京玛格泰克科技发展有限公司设计开发 技术支持:support@magtech.com.cn