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

Inputs                      Ladder logic program                    Outputs
                       L1                                                                                      L2
                                                                   MUL
                                 ON/OFF                            MULTIPLY                 Heater
                                                                   Source A        I:012
                                                                                   400
                                                                   Source B   0.0100000
                          TWS
                           1                                       Destination     N7:0
                                                                                     4
                           2      I:012                                                        PL1
                           3                                       ADD
                                                                   ADD
                                                                   Source A        I:012
                                                                                   400
                                                                   Source B        N7:0
                           I:013                                                     4        PL2
                                                                   Destination     N7:1
                                                                                   404
                        Thermocouple
                           input
                                                                   SUB
                                                                   SUBTRACT
                                                                   Source A        I:012
                                                                                   400
                                                                   Source B        N7:0
                                                                                     4
                                                                   Destination     N7:2
                                                                                   396


                                                                                  PL1
                                             LES
                                             LESS THAN
                                             Source A        I:013
                                                               0
                                             Source B        N7:2
                                                             396
                                                                                  PL2
                                             GRT
                                             GREATER THAN
                                             Source A        I:013
                                                               0
                                                             N7:1
                                             Source B        404

                                             ON/OFF        PL1       PL2         Heater

                                                          Heater



                       Figure 11-38  Program for Problem 3.




                    O:023 for the LEDs. Include the provision to          •  Multiply the value in N7:3 by 25 and store the
                    change the preset value of the timer from a set of      result in N7:4.
                    4-digit BCD thumbwheels when input A is true.         •  Divide the value in N7:4 by 35 and store the
                    Use address I:012 for the thumbwheels.                  result in F8:0.
                 7. Design a program that will implement the follow-   8. a.  There are three part conveyor lines (1-2-3) feed-
                    ing arithmetic operation:                                ing a main conveyor. Each of the three conveyor
                    •  Use an MOV instruction and place the value 45         lines has its own counter. Construct a PLC pro-
                      in N7:0 and 286 in N7:1.                               gram to obtain the total count of parts on the
                    •  Add the values together and store the result in N7:2.  main conveyor.
                    •  Subtract the value in N7:2 from 785 and store the   b. Add a timer to the program that will update the
                      result in N7:3.                                        total count every 30 s.



               250        Chapter 11  Math Instructions







          pet73842_ch11_234-251.indd   250                                                                              03/11/15   4:08 PM
   264   265   266   267   268   269   270   271   272   273   274