摘要
为解决目前国内各厂家PLC(programmable logic controller)产品的编程语言互不兼容,使得不同系列产品的PLC编译器可重用性很低的问题,设计实现了基于IEC61131-3标准的IL(instruction list)语言编译器。首先设计了编译器的逻辑结构,借助Flex和GNUBison工具,按照标准IL语言的词法、语法要求,设计并实现了词法、语法分析器,简述了生成目标代码具体实现方法,然后在数控系统中进行了测试运行。实验结果表明,该编译器能正确解释标准IL语言的用户程序,且运行可靠。
To solve the low-reusability problem with PLC compiler which is rooted from the reality that in our country,PLC programming languages used by each manufacturer can't be compatible,a compiler based on IEC61131-3 standard is designed and implemented.Firstly,the logical structure of the compiler is devised.Secondly,with the help of Flex and GNU Bison tools,lexical and syntax analyzers are constructed according to the lexical and syntax rules in standard IL language.Then,the concrete method to produce object code is presented.Finally,the compiler is tested and validated in the CNC(computerized numerical control) system.The result shows that the compiler can translate user's programs correctly and work reliably.
出处
《计算机工程与设计》
CSCD
北大核心
2010年第10期2300-2302,2307,共4页
Computer Engineering and Design
关键词
IEC61131-3标准
指令表
编译器
可编程控制器
数控系统
IEC61131-3 standard
instruction list
compiler
programmable logic controller
computerized numerical control system