本文提供了一种基于 PLC 开关量输入单元的转速信号测量方法,该方法的特点在于测量成本低、可靠性高、测量精度和刷新时间稳定。文中举出了用PLC 开关量输入单元测量频率的成本优势,并讨论了常见的频率测量算法存在的问题,然后引入了一种变时间 窗多周期频率测量算法,从而克服了常见的频率测量算法测量精度和刷新时间不稳定的缺点。针对转速信号测量的硬件,分析了PLC 自身特点对频率测量的影响,以及如何解决。最后给出了算法的程序流程。 关键字:PLC;开关量输入;频率测量;时间窗 Abstract: This paper presents a approach measuring the rotate speed with digital IO input unit of PLC. This method characters high reliability, low cost and stable precision and fresh time. It illustrates the advantage of this method in low cost, discusses some common technique to measure frequency and recommends a arithmetic of MVTW ( multicycle and vary timing window ) that implements the stable precision and fresh time. As the hardware of measurement, It discusses the influences on measuring frequency from the feature of PLC, and how to deal with these influences. At last, It provides the flow of the approach. Keywords: PLC; input IO unit; frequency measurement; timing window