Delta DVP — 2.4 24-hour Clock Operated by 3 Counters

2. Counter Design Examples 2.4 24-hour Clock Operated by 3 Counters Hour Minute Second Control Purpose: z Using 3 counters together with the flag of M1013 (1s clock pulse) to operate a 24-hour clock. Devices: Control Program: M1013 CNT C0 CNT RST C0 C1 CNT RST C1 C2 Program Description: z The key of operating a 24-hour clock is to use M1013 (1s clock pulse). When the program is executed, C0 will count once per second. When the counted number reaches 60(1 minute), C0 = ON. C1 will count once, and C0 will be reset at the same time; similarly, when the counted number in C1 reaches 60(1 hour), C1 = ON. C2 will count once, and C1 will be reset at the same time.

Furthermore, when the present value in C2 reaches 24, C2 will be reset, and the 24-hour counting process will start again. z The 24-hour clock operates by using C0 to count “second”, C1 to count “minute” and C2 to count “hour.” In this clock, the value of “second”, “minute” and “hour” can be read by C0, C1 and C2 correspondingly. When the set value of C2 is 12, the clock will be a 12-hour clock. DVP-PLC Application Examples 2-5 Device Function C0 count per second C1 count per minute C2 count per hour M1013 1s clock pulse C0 K60 C1 K60 C2 K24 RST C2