192 Programmable Logic Controllers: Hardware and Programming 9.4 PLC Count Down Instructions In the PLC count down instruction, the accumulated register decrements whenever the counter input device changes state. Therefore, the preset value for the count down is usually a negative number. The content of the accumulated register decrements from its initial value of zero to the negative preset number. Figure 9-4 displays a count down instruction that is connected to a normally open input. 0000 0001 0002 CTD Count down Counter C5:0 Preset -15 Accum 0 End CD DN Pushbutton 1 I:0 Switch 0 I:0 RES C5:0 Goodheart-Willcox Publisher Figure 9-4. PLC count down instruction. The low-to-high pulse on the count down input (Pushbutton) decrements the counter. Notice that in the count up instruction, the done bit (C5:0/DN) is enabled and the done coil energizes when the content of the accumulated register is equal to the content of the preset register. In the count down instruction, the done bit (C5:0/DN) resets to zero and the done coil de-energizes when the content of the accumulated register decrements to the preset number. Example 9-2 illustrates how a count down instruction is used in the PLC ladder logic diagram. Examine Figure 9-5. This fi gure displays the PLC ladder logic diagram for Example 9-2. fi 0000 0001 0004 CTD Count down Counter C5:0 Preset -15 Accum 0 End CD 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-5. PLC ladder logic diagram for Example 9-2. Example 9-2
Previous Page Next Page