Copyright Goodheart-Willcox Co., Inc. 196 9.7 Creating PLC Ladder Logic Diagrams with Counters and Timers In previous sections, the ladder logic diagrams used only counter instructions. In this section, you will create a ladder diagram that has both counter and timer instructions. Example 9-5 illustrates how to use counter and timer instructions to create a twenty-four hour clock. 9.8 LogixPro Simulator Examples The following examples show PLC ladder logic diagrams built in the LogixPro 500 simulation software for common counting applications. Study and reproduce these examples to become familiar with use of the count-up and count-down instructions in ladder logic diagrams. Examine Figure 9-9. This fi gure displays the PLC ladder logic diagram for Example 9-5. First, notice that fi Switch I:0/0 is composed of 1 NO contact on rung 000 and three NC contacts on rungs 003, 005, and 006. In rung 000, the switch is used to begin and end the operation. In rungs 003, 005, and 006, the switch is used to reset the counters when the program is not operating. Closing the normally open switch in rung 0000 starts timer zero (T4:0). This timer has a time base of 0.01 second. Therefore, to reach a 1-second time, the content of the timer’s accumulated register must reach 100. When the timer reaches 100, the timer’s done coil (T4:0/DN) energizes. When the timer done coil energizes, the normally open timer done contact (T4:0/DN) in rung 0001 closes to increment the counter zero (C5:0). Also, the normally closed timer done contact (T4:0/DN) in rung 0000 opens to reset the timer (T4:0). Every time the timer times for one second, counter zero (C5:0) in rung 0001 increments. When the content of the accumulated register in counter zero (C5:0) reaches sixty (60), the counter done bit (C5:0/DN) is enabled and the counter done coil is energized. Now, the normally open counter done contact (C5:0/DN) in rung 0002 closes to increment counter one (C5:1). Also, the normally open counter done contact (C5:0/DN) in rung 0003 closes to reset counter zero (C5:0). When the content of accumulated register in counter one (C5:1) reaches sixty (60), the counter done bit (C5:1/DN) is enabled and the counter done coil is energized. Then, the normally open contact in rung 0004 closes to increment counter two (C5:2). Also, the normally open counter done contact (C5:1/DN) in rung 0005 closes to reset counter one (C5:1). Notice that the content of the preset register in counter two (C5:2.PRE) is set for twenty-four. Therefore, the normally open contact (C5:2/DN) in rung 0006 will close every twenty-four hours to reset counter two (C5:2). If you open the switch (Switch), the timer and the counter instructions all will reset to zero. Example 9-5 Pressing the pushbutton in rung 0000 ten times increments the content of the accumulated register in counter zero (C5:0). When the content of the accumulated register in counter zero is equal to the preset number ten, the counter done bit (C5:0/DN) is enabled and the counter done coil is energized. Now, the normally open counter done contact (C5:0/DN) in rung 0001 closes to increment the content of the accumulated register in counter instruction one (C5:1). Also, the normally open counter done contact (C5:0/DN) in rung 0003 closes to reset counter zero (C5:0). Every time counter zero counts up to ten, the content of accumulated register in counter one (C5:1) increments once. When the content of the accumulated register in counter one reaches five, its counter done fi bit (C5:1/DN) is enabled and the counter done coil is energized. When this happens, the normally open contact in rung 0002 (C5:1/DN) closes to turn on the green pilot light (Green_PLT). Closing the normally open switch (Switch) resets both counters.