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

L1      Inputs                       Ladder Logic program             Outputs  L2
                                                     PB_10s
                                                  <Local:1:I.Data.1>  MOV
                                     PB_10s                           Move                      PL_1
                                                                      Source      10000
                                                                      Dest       T1.PRE
                                                                                  10000

                                                     PB_15s
                                                                                               PL_2
                                                 <Local:1:I.Data.2>                            PL_2
                                                                      MOV
                                     PB_15s                           Move
                                                                      Source      15000
                                                                      Dest       T1.PRE
                                                                                  10000
                                                   Timer_Start
                                                 <Local:1:I.Data.3>  TON
                                     Timer_Start                  TIMER ON DELAY      EN
                                                                  Timer          T1
                                                                  Preset      10000  DN
                                                                  Accum          0
                                                                                   PL_1
                                                  T1.TT                       <Local:2:O.Data.1>


                                                                                   PL_2
                                                  T1.DN                       <Local:2:O.Data.2>



                            Figure 15-91   MOV instruction used to create a variable preset timer.

               Combining Math, Comparison,                             •  The BCD_Display board monitors the decimal
               and Move Instructions                                      setting of the BCD_ TWS.
                                                                       •  The MOV instruction is used to move the data
                  Combining math, comparison, and move instructions       (in the form of BCD) from the BCD_TWS to the
               provides a PLC with the ability to perform more complex    BCD_Display.
               operations. Figure 15-92 shows a PAC Logix program      •  The setting of BCD_TWS is compared to the deci-
               designed so that the BCD_Display displays the setting of   mal reference number 20 (BCD 100000) stored in
               the BCD_TWS (thumbwheel switch). Both the MOV and          Source B of the EQU instruction.
               EQU instructions form part of the program. The operation
               of the program can be summarized as follows:            •  The EQUAL_ PL output is energized whenever
                                                                          the PL_Equal_Sw is true (closed) and the


                       Inputs                            Ladder logic program                            Outputs
                L1                                             MOV                                                    L2
                                                Move
                                               Source                                                                      BCD_TWS
                        PL_Equal_Sw                 2#0000_0000_0000_0000_0000_0000_0010_0000            Equal_PL
                                               Dest                                                                     BCD_Display
                                                    2#0000_0000_0000_0000_0000_0000_0010_0000
                                    PL_Equal_Sw                                         Equal_PL
                         BCD_TWS   <Local:1:I.Data.0>                                <Local:2:O.Data.0>
                                                                EQU                                 BCD_Display
                        (All 16 bits)           Equal
                                                Source A                                                                  BCD_TWS  (All 16 bits)
                                                     2#0000_0000_0000_0000_0000_0000_0010_0000
                  Thumbwheel switch
                                                Source B                                                                    Source_B
                                                     2#0000_0000_0000_0000_0000_0000_0010_0000
                  0  0  2  0                                                                                  0 0 2  0
                     Decimal                             20 Decimal = 100000 BCD                              Decimal
               Figure 15-92  Monitoring the setting of a thumbwheel switch.



               380        Part 5  Math, Comparison, and Move Instructions







          pet73842_ch15_333-394.indd   380                                                                              03/11/15   7:34 PM
   394   395   396   397   398   399   400   401   402   403   404