Copyright Goodheart-Willcox Co., Inc. 193 9.5 Connecting PLC Counter Instructions In some manufacturing operations, the content of an entire section of a conveyor needs to be known at one time. This can be accomplished by placing two proximity sensors on the conveyor. One proximity sensor is connected to a count up instruction, and the other one is connected to a count down instruction. Figure 9-6 displays the conveyor and the proximity sensors. You can create a PLC ladder diagram that will hold the number of parts on the conveyor in a PLC register. Example 9-3 illustrates how to create a program to count the number of parts on a given section of a conveyor. Transmitter Transmitter Conveyor Receiver Receiver Proximity switch Count down input Count up input Infrared light beam Parts Proximity switch Goodheart-Willcox Publisher Figure 9-6. Count up proximity switches used to keep count of items on a conveyor. The done bit (C5:0/DN) for the counter instruction is normally enabled and the done coil is energized. Therefore, the normally closed contact (C5:0/DN) in rung 0001 is opened. This means that the green pilot light (Green_PLT) is turned off. Also, the normally open contact (C5:0/DN) in rung 0002 is closed and the red pilot light (Red_PLT) is on. Press the pushbutton 15 times to decrement the content of the accumulated register from 0 to –15. Notice that the done coil is still energized. Pressing the pushbutton once more decrements the content of the accumulated register to –16. Now the done coil bit (C5:0/DN) de-energizes. When the done coil de-energizes, the normally closed contact (C5:0/DN) in rung 0001 reverts to its normally closed state and the green pilot light (Green_PLT) turns on. Also, the normally open contact (C5:0/DN) in rung 0002 reverts to its normally open state and the red pilot light (Red_PLT) turns off. In summary, in the count down instruction, the content of the accumulated register decrements. When the content of the accumulated register is one count below the content of the preset register, the done coil (C5:0/DN) de-energizes. If you press the pushbutton in this setup a few more times, the content of the accumulated register continues to decrement. However, the done coil remains de-energized. Closing the normally open switch (Switch) resets the count down instruction. Now the done coil (C5:0/DN) energizes again to turn on the red pilot light (Red_PLT) and to turn off the green pilot light (Green_PLT).