Page 193 - Programmable Logic Controllers, Fifth Edition - Mobile version
P. 193

Optical
                                           sensor
                                             Light                                                               Wood
                                           source

                                                                                                   Cutter
                                                                                                   control
                                           Optical
                                          encoder

                    Generated pulses               Optical                           Rotary
                                                    disk                             encoder
                                                                                                          Programmable
                                                                                             Pulses       controller
                                                                     Figure 8-32  Cutting objects to a specified length.
                                         Lines

                                                                       •  The photoelectric sensor monitors a reference point
                                                                          on the conveyor. When activated, it prevents the unit
               Figure 8-31  Optical incremental encoder.
               Source: Courtesy of Nidec Avtron Automation.               from counting, thus permitting the counter to accu-
                                                                          mulate counts only when bar stock is moving.
               of random pieces of bar stock moved on a conveyor. The   •  The counter is reset by closing the reset button.
               operation of the program can be summarized as follows:
                 •  Count input pulses are generated by the magnetic   8.6  Combining Counter
                    sensor, which detects passing teeth on a conveyor
                    drive sprocket.                                  and Timer Functions
                 •  If 10 teeth per foot of conveyor motion pass the   Many PLC applications use both the counter function and
                    sensor, the accumulated count of the counter would   the timer function. Figure 8-34 illustrates an automatic
                    indicate feet in tenths.                         stacking program that requires both a timer and counter.
                                       Sprocket
                                                  Magnetic
                                                   sensor                           Photoelectric
                                                                                      sensor




                                                        Conveyor
                                                                              Reflector

                                                                   (a)
                                                                     Ladder logic program
                                          Inputs
                                  L1                  Magnetic  Photo        10 counts per foot
                                                       sensor   sensor
                                                                          CTU
                                            Magnetic                      COUNT-UP COUNTER       CU
                                             sensor                       Counter         C5:1
                                                                          Preset            10   DN
                                                                          Accumulated       0
                                             Photo
                                             sensor

                                                       Reset
                                                                                               C5:1
                                           Reset                                               RES

                                                                  (b)
                                  Figure 8-33  Counter used for length measurement. (a) Process. (b) Program.



               174        Chapter 8  Programming Counters







          pet73842_ch08_156-183.indd   174                                                                              03/11/15   3:58 PM
   188   189   190   191   192   193   194   195   196   197   198