Timer Test
Timer elements are tested in this section. Both TON and TOF types were used, with different expiration times. As per IEC 61131-3 definition, a TON timer supplies a rising edge of the input IN at the output Q after a time delay PT. If the input pulse is shorter than PT, the timer is not started and the output Q remains false. The TOF timer performs the inverse function to TON, i.e. it supplies a rising edge on the input IN at the output Q immediately but delays a falling edge of the input into the output Q.
For the segment of the ladder test program shown below, the output O2 is set to true if one of the parallel TON timers receives an input pulse larger than the PT value. Timers TON0 to TON3 are activated by the inputs I1, I2, I3, and I4. O2 should remain active until the TOF timer in the series expires. For example, O2 will be activated if I1 has been active for 1000 ms continuously, and it will be automatically inactivated after 500 ms.