Page 178 - Programmable Logic Controllers, Fifth Edition
P. 178

8.2  Up-Counter
                                                                           Figure 8-8 shows the program and timing diagram for
                                                                         an SLC 500 Count-Up Counter. This control application
                   The up-counter is an output instruction whose function   is designed to turn the red pilot light on and the green pilot
                   is to increment its accumulated value on false-to-true   light off after an accumulated count of 7. The operation of
                   transitions of its instruction. It thus can be used to count   the program can be summarized as follows:
                   false-to-true transitions of an input instruction and then
                   trigger an event after a required number of counts or tran-  •  Operating pushbutton PB1 provides the off-to-on
                   sitions. The up-counter output instruction will increment   transition pulses that are counted by the counter.
                   by 1 each time the counted event occurs.                •  The preset value of the counter is set for 7.

                                L1    Inputs                     Ladder logic program               Outputs  L2
                                                       I:1/0
                                                                   CTU
                                           Rung 1                  COUNT-UP COUNTER        CU
                                                     PB1 (Count)   Counter         C5:1               Red PL
                                  PB1 (Count)                      Preset            7     DN     O:2/0  R
                                                                   Accumulated       0
                                            I:1/0
                                                      C5:1/DN                            O:2/0
                                                                                                  O:2/1  G
                                           Rung 2
                                                                                                      Green PL
                                  PB2 (Reset)      Counter done bit                      Red PL
                                            I:1/1     C5:1/DN                            O:2/1
                                           Rung 3
                                                   Counter done bit                     Green PL

                                                       I:1/1                              C5:1
                                           Rung 4                                         RES
                                                     PB2 (Reset)


                                                                      (a)

                                                   True  1   2   3    4    5    6    7
                                            Rung 1
                                            (count)
                                                  False
                                           Rung 2




                                           Rung 3




                                           Rung 4
                                            (reset)



                                            Preset                             6  7
                                           value (7)                     5
                                                                     4
                                                                3
                                       Accumulated          2
                                             value   1

                                                                      (b)
                                Figure 8-8  Simple up-counter program. (a) Program. (b) Timing diagram.



                                                                                     Programming Counters  Chapter 8    159







          pet73842_ch08_156-183.indd   159                                                                              03/11/15   3:58 PM
   173   174   175   176   177   178   179   180   181   182   183