3 . Timer Design Examples Control Program: X0 X0 Y0 T0 M0 M2 X0 M0 M1 M1 T2 M0 T1 M2 Y0 X0 M0 T2 M1 X0 Program Description: z When a user is detected, infrared sensor X0 will be ON. In this case, T0 will be ON and start to count for 3 sec. If the user leaves in 3 sec, X0 = OFF, and T0 will be OFF. No action will be performed. If the user stands for more than 3 sec, the NO contact T0 will be activated, which turns on M0. The first flushing will start (Y0 = ON). z M1 is latched in this program. If the user leaves after 3 sec, which means the NO contact M0 = ON and the NC contact X0 is OFF, M1 will be ON and latched. The second flushing will then be started.
After 4 sec, both the NO contact and the NC contact of T2 will be activated. Therefore, Y0 will be OFF, and the flushing will be stopped. M0 and M1 will be reset. Because M1 is latched, the second flushing process will certainly be executed whether X0 changes its state or not. DVP-PLC Application Examples 3-20 TMR T0 K30 SET M2 SET M0 TMR T1 K30 TMR T2 K40 ZRST M0 M1 RST M2