Copyright Goodheart-Willcox Co., Inc. Chapter 9 PLC Counter Instructions 191 The low-to-high change of state on input one (I:0/1) increments the number in the accumulated register of the count up instruction. When the content of the preset register and the accumulated register are equal, the done bit (C5:0/DN) is enabled and the done coil is energized. If the counter input (I:0/1) changes state (low-to-high) when the accumulated value reaches the preset value, the accumulated register increments again. However, the done bit (C5:0/DN) remains enabled until the counter is reset. Whenever the input opens and closes (low-to-high), the count status bit (C:0/CU) enables and the count up coil energizes. The reset (RES) instruction is used to reset the accumulated register to zero. The normally open input zero (I:0/0) must be closed to reset the counter. Example 9-1 illustrates how a count up instruction is used in ladder logic diagrams. Examine Figure 9-3. This fi gure displays the PLC ladder logic diagram for Example 9-1. fi 0000 0001 0004 CTU Count up Counter C5:0 Preset 10 Accum 0 End CU DN Pushbutton 1 I:0 Green_PLT 0 O:0 Red_PLT 1 O:0 DN C5:0 0002 DN C5:0 0003 RES Switch 0 I:0 C5:0 Goodheart-Willcox Publisher Figure 9-3. PLC ladder logic diagram for Example 9-1. The counter done bit (C5:0/DN) is normally disabled. Therefore, the normally closed done contact (C5:0/DN) is closed and the green pilot light (Green_PLT) is normally on. Press the pushbutton 10 times. Notice that the content of the accumulated register increments 10 times. When the content of the accumulated register reaches 10, the done bit (C5:0/DN) is enabled and the done coil is energized. The normally closed contact in rung 0001 opens to turn off the green pilot light (Green_PLT). The normally open contact in rung 0002 closes to turn on the red pilot light (Red_PLT). Press pushbutton I:0/0 a few more times. The accumulated value will increase and the status bit (C5:0/DN) remains high. The only way to reset the counter is through the reset (RES) instruction. Closing the normally open switch (Switch) resets the counter. This causes the content of the accumulated register (C5:0.ACC) to reset to zero. The green pilot light (Green_PLT) turns on again and the red pilot light (Red_PLT) turns off. Example 9-1