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

L1       Inputs                       Ladder logic program                      Outputs      L2
                                                                    MUL
                                ON/OFF                              MULTIPLY                  Heater
                                                                    Source A       I:012
                                                                                    400
                                                                    Source B   0.0100000
                        TWS                                         Destination    N7:0           PL1
                         1                                                           4
                         2      I:012
                                                                    ADD
                         3
                                                                    ADD
                                                                    Source A       I:012
                          4  0   0                                                  400
                                                                    Source B       N7:0
                                                                                     4
                                                      High limit    Destination     N7:1
                                                                                    404
                                                                    SUB                           PL2
                         I:013                                      SUBTRACT
                                                                    Source A       I:012
                                                                                    400
                      Thermocouple                                  Source B       N7:0
                         input                                                       4
                                                       Low limit    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-11  The MUL instruction used as part of a temperature control program.




                 •  In this example, the set-point temperature is 400°F.  11.5  Division Instruction
                 •  Therefore, the electric heaters will be turned on   The divide (DIV) instruction divides the value in source A
                    when the temperature of the oven drops to less than   by the value in source B and stores the result in the desti-
                    396°F and stay on until the temperature rises above   nation and math register. Figure 11-12 shows an example
                    404°F.                                           of the DIV instruction. The operation of the logic rung
                 •  If the set-point is changed to 100°F, the deadband   can be summarized as follows:
                    remains at ±1 percent, with the lower limit being
                    99°F and the upper limit being 101°F.              •  When input switch SW is closed the rung will be true.
                 •  The number stored in word N7:1 represents the      •  The data in source A (the accumulated value of
                    upper temperature limit, and the number stored in     counter C5:10) is then divided by the data in source
                    word N7:2 represents the lower limit.                 B (the constant 2).



               240        Chapter 11  Math Instructions







          pet73842_ch11_234-251.indd   240                                                                              03/11/15   4:07 PM
   254   255   256   257   258   259   260   261   262   263   264