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

3. Answer the questions, in sequence, for the jump-
                        to-subroutine and return program in Figure 9-31.   4. Answer the questions, in sequence, for Figure 9-32.
                                                                              Assume all switches are turned off after each
                        Assume all switches are turned off after each         operation.
                        operation.                                            a. Switches S2, S12, and S5 are turned on in order.
                        a. Switches S1, S3, S4, and S5 are all turned           Will output PL5 be energized? Why?
                          on. Which pilot light will not be turned on?        b. All switches except S7 are turned off. Will RTO
                          Why?                                                  start timing? Why?
                        b. Switch S2 is turned on and then switch S4          c. Switches S3 and S8 are turned on in order. Will
                          is turned on. Will output PL3 be energized?           pilot light PL2 come on? Why?
                          Why?                                                d. When will timer TON function?
                        c. To what rung does the RET instruction return the   e. Assume all switches are turned on. In what order
                          program scan?                                         will the rungs be scanned?
                                                                              f.  Assume all switches are turned off. In what
                                                                                order will the rungs be scanned?



                                                                Ladder logic program
                                         Inputs                  Main program file 2             Outputs
                                      L1
                                                        S1                            PL1               L2
                                               S1  1                                         PL1
                                                       S2           JSR
                                               S2                   JUMP-TO-SUBROUTINE
                                                   2
                                                                    SBR file number  U:3      PL2
                                               S3
                                                        S3                            PL2
                                                   3                                         PL3
                                               S4
                                                       S5                             PL4
                                               S5  4                                         PL4

                                                                   Subroutine file 3
                                                                        S4            PL3
                                                        SBR
                                                   5    SUBROUTINE
                                                                              RET
                                                   6                          RETURN

                                      Figure 9-31  Program for Problem 3.





























                                                                               Program Control Instructions   Chapter 9  205







          pet73842_ch09_184-206.indd   205                                                                              03/11/15   4:01 PM
   219   220   221   222   223   224   225   226   227   228   229