Page 251 - Programmable Logic Controllers, Fifth Edition
        P. 251
     L1       Inputs                   Ladder logic program             Output  L2
                                                    Count PB
                                                              CTU
                                         Count PB             COUNT UP                CU      PL1
                                                              Counter         C5:1
                                                              Preset          000    DN
                                                              Accumulated     000
                                        Reset PB
                                                                        MOV
                                                                        MOVE
                                         N7:10                          Source       N7:10
                                                                        Destination  C5:1.PRE
                                                       C5:1/DN                     PL1
                                                       Reset PB                    C5:1
                                                                                   RES
                             Figure 10-50  Program for Problem 2.
                                          Inputs               Ladder logic program        Output
                                  L1                         EQU                                   L2
                                                       S1                         PL1
                                                             EQUAL
                                                             Source  A   N7:112
                                             S1                                          PL1
                                                             Source  B     004
                                               N7:112
                                   Thumbwheel switch
                                  Figure 10-51  Program for Problem 4.
                 5. Study the data compare program in Figure 10-52     6. Write a program to perform the following:
                    and answer the following questions:                   a. Turn on pilot light 1 (PL1) if the thumbwheel
                    a. List the values for the thumbwheel switch that        switch value is less than 4.
                       would allow the pilot light to turn on.            b. Turn on pilot light 2 (PL2) if the thumbwheel
                    b. If the value in the word N7:112 is 003 and switch     switch value is equal to 4.
                       S1 is open, will the pilot light turn on? Why?     c. Turn on pilot light 3 (PL3) if the thumbwheel
                    c. Assume that source B is addressed to the accu-        switch value is greater than 4.
                       mulated count of an up-counter. With S1 closed,    d. Turn on pilot light 4 (PL4) if the thumbwheel
                       what setting of the thumbwheel switch would be        switch value is less than or equal to 4.
                       required to turn the pilot light off when the ac-  e. Turn on pilot light 5 (PL5) if the thumbwheel
                       cumulated count reaches 150?                          switch value is greater than or equal to 4.
               232        Chapter 10  Data Manipulation Instructions
          pet73842_ch10_207-233.indd   232                                                                              03/11/15   4:03 PM





