摘要
针对目前PLC梯形图编辑软件的缺陷和不足,基于面向对象的设计思想,提出了一种全新的将梯形图转化为指令表的优化算法。介绍了语法检查、构造逻辑树结构和遍历树结构得到相应指令集三个具体过程的解决方案。结合灵活的类管理机制,将该算法应用于编辑软件,成功地解决了图形语言向文本语言的转化。由于指令程序比较接近于机器语言,将梯形图转换成指令表以后,通过指令解释器对指令表的解释得出程序的逻辑,可以在PC机上执行程序。使用该算法开发出来的PLC编辑软件,作为一个编写PLC程序的通用开发平台,它功能强大、操作简单、使用方便。
Aiming at the limitation and lack of the current editing software for PLC ladder diagram, based on the idea of oriented-object , an optimal algorithm to convert ladder diagram to instruction table is presented. A concrete solution of grammar checking, constructing logic tree and traversal of the tree to come up with instruction table are introduced. With flexible mechanism of class management, the algorithm is successfally applied to the editing software to realize the transformation from graph language to text language. As procedure is fairly close to the binary code, PLC ladder diagram is transformed to the instruction table, then the logic of procedure is educed through the explanation to the instruction table of interpreter, so that the procedure can be run on PC. The software based on this algorithm is powerful and simple to operate, and convenient to use.
出处
《控制工程》
CSCD
2006年第6期573-576,共4页
Control Engineering of China
关键词
梯形图
指令表
树
扫描
编译
ladder diagram
instruction table
tree
scanning
compile