Page 73

Petruzella_ProgrammableLogicControllers__5e

Tag Name Value Style Data Type -Amber_Light_Timer {…} TIMER TIMER TIMER {…} {…} 30000 Decimal DINT DINT BOOL BOOL BOOL BOOL BOOL BOOL Decimal Decimal Decimal Decimal Decimal Decimal Decimal 0 1 1 0 1 0 0 -Green_Light_Timer -Red_Light_Timer -Red_Light_Timer.PRE -Red_Light_Timer.ACC Red_Light_Timer.EN Red_Light_Timer.TT Red_Light_Timer.DN Red_Light Green_Light Amber_Light shown in Figure 15-56. Operation of the program can be summarized as follows: • Transition from red light to green light to amber light is accomplished by the interconnection of the EN and DN bits of the three TON timer instructions. • The input to the Red_Light_Timer is controlled by the Amber_Light_Timer.DN bit. • The input to the Green_Light_Timer is controlled by the Red_Light_Timer.DN bit. • The input to the Amber_Light_Timer is controlled by the Green_Light_Timer.DN bit. • The timed sequence of the lights is: -- Red—30 s on -- Green—25 s on -- Amber—5 s on • The sequence then repeats itself. Off-Delay Timer (TOF) The off-delay timer (TOF) operates in a fashion opposite to the TON on-delay timer. An off-delay timer will turn on immediately when the rung of ladder logic is true, Input Ladder logic program Output L1 L2 362 Part 3  Programming Timers Tag name TOF TIMER OFF DELAY Timer Sample_TOF Preset 5000 Accum 0 Input side of rung EN DN but it will delay before turning off after the rung goes false. The ControlLogix TOF off-delay timer instruction is shown in Figure 15-57. The description of the function block fields and tag references are the same as for that of a TON timer. Figure 15-58 shows a program that uses a TOF timer to illuminate a green pilot light for 20 seconds each time a momentary button is pressed. The program code is simpler than that used to accomplish the same task using a TON timer. The operation of the program can be summarized as follows: • When the Timer_Button is initially closed the timer rung and instruction and DN bit all become true. • The DN bit switches on the Green_PL and the program remains in this state as long as the button is held closed. • When the button is released the Timer_Button instruction goes false and starts the timing cycle. • The light remains on and the timer begins accumulating time. • When the accumulator reaches 20000 ms (20 s) the timer DN bit becomes false and the light is switched off. The program of Figure 15-59 uses both on-delay and off-delay timers for control of a heating oven process. The different tags created to fit the program are shown Figure 15-56  Tags created for traffic light program. Figure 15-57  ControlLogix TOF off-delay timer instruction. Figure 15-58  Pilot light TOF timer. Green_ PL Timer_Button Timer_Button <Local:1:I.Data.0> Pilot_Light_Timer.DN TOF TIMER OFF DELAY Timer Preset Accum Pilot_Light_Timer 20000 0 Green_PL EN DN <Local:2:O.Data.3>


Petruzella_ProgrammableLogicControllers__5e
To see the actual publication please follow the link above