Page 91

Petruzella_ProgrammableLogicControllers__5e

Ladder Logic program Outputs DN Figure 15-91  MOV instruction used to create a variable preset timer. Combining Math, Comparison, and Move Instructions Combining math, comparison, and move instructions provides a PLC with the ability to perform more complex operations. Figure 15-92 shows a PAC Logix program designed so that the BCD_Display displays the setting of the BCD_TWS (thumbwheel switch). Both the MOV and EQU instructions form part of the program. The operation of the program can be summarized as follows: Inputs Ladder logic program PL_Equal_Sw BCD_TWS (All 16 bits) Thumbwheel switch L1 Decimal MOV PL_Equal_Sw <Local:1:I.Data.0> 380 Part 5  Math, Comparison, and Move Instructions L2 PL_1 PL_2 • The BCD_Display board monitors the decimal setting of the BCD_ TWS. • The MOV instruction is used to move the data (in the form of BCD) from the BCD_TWS to the BCD_Display. • The setting of BCD_TWS is compared to the decimal reference number 20 (BCD 100000) stored in Source B of the EQU instruction. • The EQUAL_ PL output is energized whenever the PL_Equal_Sw is true (closed) and the L1 Inputs PB_10s PB_15s Timer_Start Move Source Dest 10000 T1.PRE 10000 MOV PB_10s <Local:1:I.Data.1> Move Source Dest 15000 T1.PRE 10000 MOV PB_15s <Local:1:I.Data.2> TIMER ON DELAY Timer Preset Accum T1 100000 TON Timer_Start <Local:1:I.Data.3> EN T1.TT PL_1 <Local:2:O.Data.1> T1.DN PL_2 <Local:2:O.Data.2> PL_2 Figure 15-92  Monitoring the setting of a thumbwheel switch. Equal_PL <Local:2:O.Data.0> Move Source BCD_TWS 2#0000_0000_0000_0000_0000_0000_0010_0000 Dest BCD_Display 2#0000_0000_0000_0000_0000_0000_0010_0000 EQU Equal Source A BCD_TWS 2#0000_0000_0000_0000_0000_0000_0010_0000 Source B Source_B 2#0000_0000_0000_0000_0000_0000_0010_0000 Outputs Equal_PL BCD_Display (All 16 bits) 0 0 2 0 Decimal L2 20 Decimal = 100000 BCD 0 0 2 0


Petruzella_ProgrammableLogicControllers__5e
To see the actual publication please follow the link above