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

Ladder logic program
                     L1      Input            Timer_Button     Green_PL                                       Output    L2
                                             <Local:1:I.Data.0>  <Local:2:O.Data.3>  TON
                              Timer_Button                         L        TIMER ON DELAY          EN
                                                                            Timer  Pilot_Light_Timer      Green_ PL
                                            Pilot_Light_Timer.EN            Preset        20000     DN
                                                                            Accum              0

                                                                                             Green_PL
                                            Pilot_Light_Timer.DN          Pilot_Light_Timer  <Local:2:O.Data.3>
                                                                               RES              U


                     Figure 15-54  Pilot light TON timer.


                     •  Momentary detection of the target by the SOL_      •  When the button is then opened the timer rung
                       Deenergize_Sensor causes the opening of its con-      remains true through the logic path created by the
                       tacts and resets the program to its original state.   Pilot_Light_Timer.EN bit.
                     Figure 15-54 shows a program that uses a TON timer to   •  After 20000 ms (20 s) have elapsed the timer DN
                   illuminate a green pilot light for 20 seconds each time a mo-  bit is set to reset the timer to its original state and
                   mentary button is pressed. In addition to the TON timer this   unlatch the Green_PL and switch it off.
                   program uses multiple outputs on one rung, output latch and   The ControlLogix program of Figure 15-55 shows
                   unlatch instructions, as well as a timer reset instruction. The   three TON timers cascaded (connected together) for traf-
                   operation of the program can be summarized as follows:  fic light control. The ladder logic used is the same as that
                     •  Initially closing the Timer_Button sets (latches) the   used to program the traffic lights using the SLC 500 con-
                       Green_PL on and enables the Pilot_Light_Timer.    troller. The different tags created to fit the program are

                                                    Ladder logic program                          Outputs
                              Amber_Light_Timer.DN
                                                            TON
                                                            TIMER ON DELAY           EN                         L2
                                                            Timer   Red_Light_Timer
                                                            Preset          30000    DN      Red_ Light
                                                            Accum              0

                               Red_Light_Timer.DN                                           Amber_ Light
                                                            TON
                                                            TIMER ON DELAY           EN
                                                            Timer  Green_Light_Timer        Green_ Light
                                                            Preset          25000    DN
                                                            Accum              0
                               Green_Light_Timer.DN
                                                            TON
                                                            TIMER ON DELAY           EN
                                                            Timer  Amber_Light_Timer
                                                            Preset          5000     DN
                                                            Accum              0
                                                                           Red_Light
                                Red_Light_Timer.EN  Red_Light_Timer.DN  <Local:2:O.Data.0>


                                                                           Green_Light
                               Green_Light_Timer.EN  Green_Light_Timer.DN  <Local:2:O.Data.1>

                                                                          Amber_Light
                               Amber_Light_Timer.EN  Amber_Light_Timer.DN  <Local:2:O.Data.2>




                             Figure 15-55  ControlLogix traffic control program.



                                                                                         Programming Timers  Part 3     361







          pet73842_ch15_333-394.indd   361                                                                              03/11/15   7:33 PM
   375   376   377   378   379   380   381   382   383   384   385