传统PLC源程序的编译方法,虽然执行速度快,占用资源少,但可移植性差不够灵活;传统PLC源程序的解释方法虽然灵活性好,但执行速度慢且占用存储空间大。为了兼顾存储空间、执行速度和可移植性,给出了一种PLC源程序的编码方法,减少了存储空间,简化了解释执行算法,并在表达式求值算法和传统PLC解释执行算法的基础之上,充分利用逻辑运算的性质,提出了改进的PLC解释执行算法,大大减少了逻辑运算的步数,提高了PLC系统运行的速度。
Traditional PLC source program compilation methods,although fast,small footprint,but are not flexible enough and poor portability;traditional interpretation methods of PLC source program have good flexibility,but the execution is slow and it takes up storage space.In order to take into account the storage space,execution speed and portability,it gives a PLC source coding method to reduce the storage space,simplify the interpretation algorithm,based on the expression evaluation and the traditional PLC source interpretation algorithm,to take full advantage of the nature of logic operation,it proposes an improved PLC source interpretation algorithm,greatly reducing the number of logical steps,and improves the speed of the PLC system operation.