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

Pilot light





                                                     Solenoid




                                                                        Weight
                                                                        sensor


                                                                   (a)
                                                             Main program
                                Inputs                          file 2                             Outputs
                                                  Sensor     JSR
                         L1                                  JUMP-TO-SUBROUTINE                              L2
                                                             SBR file number   U:3

                                                  Sensor                       PL1           Motor    M1
                                    OFF/ON

                                                  T4:1/EN
                                    Stop                                                       PL1    PL1
                                                   Stop      Start             Motor

                                    Start
                                                            Motor                             SOL

                                    Sensor
                                                       OFF/ON    Sensor        SOL


                                                             Subroutine
                                                                file 3
                                                                 TON
                                             SBR         T4:1/DN  TIMER ON DELAY
                                             SUBROUTINE          Timer          T4:0  EN
                                                                 Time base       1.0  DN
                                                                 Preset           1
                                                                 Accumulated      0

                                             T4:0/DN             TON
                                                                 TIMER ON DELAY
                                                                 Timer          T4:1  EN
                                                                 Time base       1.0  DN
                                                                 Preset           1
                                                                 Accumulated      0
                                                                           RET
                                                                           RETURN
                                                                (b)
                        Figure 9-11  Flashing pilot light subroutine. (a) Process. (b) Program.



               192        Chapter 9  Program Control Instructions







          pet73842_ch09_184-206.indd   192                                                                              03/11/15   4:01 PM
   206   207   208   209   210   211   212   213   214   215   216