Page 90

Petruzella_ProgrammableLogicControllers__5e

Ladder Logic program L1 Inputs Count_PB Reset_PB CTU Count Up Counter Preset Accum C1 25 0 Count_PB <Local:1:I.Data.1> GRT Greater Than (A>B) Source A Source B C1.ACC 05 LES Less Than (A<B) Source A Source B C1.ACC 0 10 EQU Equal Source A Source B C1.ACC 0 15 NEQ Not Equal Source A Source B C1.DN DN <Local:2:O.Data.1> <Local:2:O.Data.2> C1.ACC 0 20 <Local:2:O.Data.3> Reset_PB <Local:1:I.Data.2> Figure 15-89  Comparison instructions used to test the accumulated value of a counter. Move Instructions The move (MOV) instruction is an output instruction that can move a constant or the contents of one memory location to another location. Figure 15-90 shows the Move toolbar and instruction for the ControlLogix controller. The MOV instruction is used to copy data from a source to Outputs L2 PL_1 PL_2 PL_3 CU PL_1 C1 RES PL_2 PL_3 a destination. Both the source and the destination data type of a MOV instruction may be INT, DINT, SINT, or REAL. The program of Figure 15-91 is an example of how the MOV instruction can be used to create a variable preset timer. The operation of the program can be summarized as follows: • Actuating the PB_10s button executes its MOV instruction to transfer 10000 to the timer preset value setting the delay period for 10 seconds. • Actuating the PB_15s button executes its MOV instruction to transfer 15000 to the timer preset value setting the delay period for 15 seconds. • Closing the Timer_Start switch starts the timer timing. • While the timer is timing, the pilot light PL_1 is on for the duration of the timer preset period. • When the timer times out, PL_1 turns off and PL_2 turns on. MOV MVM AND OR XOR SWPB NOT CLR BTD Move/Logical MOV Move Source Dest Figure 15-90  Move toolbar for the ControlLogix controller. Math, Comparison, and Move Instructions  Part 5 379


Petruzella_ProgrammableLogicControllers__5e
To see the actual publication please follow the link above