通过分析IEC 61131-3 标准规定的PLC梯形图语言及结构文本语言,提出对梯形图不同图元分类处理实现梯形图向结构文本转换的算法.该算法引入了虚节点,通过对虚节点的合并建立AOV图,按AOV图拓扑排序的顺序对不同类型节点分类处理,实现梯形图向结构文本的转换,并给出转换实例.该算法具有通用性,能转换任何复杂逻辑梯形图,已成功应用到高档数控国家工程研究中心的蓝天系列数控系统.%An algorithm of transformation from PLC ladder Diagram (LD) to structured text (ST) based on treating LD components separately in accordance with their type after Analysis of the EEC 61131-3 standard about PLC LD and ST. In this algorithm, virtual node is introduced. Virtual nodes are combined to establish activity on vertex (AOV) diagraph. Nodes are treated according to then-type and the topological sorting of the AOV diagraph, then the transformation from LD to ST is achieved. The rules of treating the nodes and a transformation are present. The algorithm is a general transformation algorithm for transformation any complex LD to ST. It is applied to Lantian series numerical control system successfully in National Engineering Research Center for High-End CNC.
展开▼