Page 70

Petruzella_ProgrammableLogicControllers__5e

value. The DN bit signals the end of the timing process by changing states from false-to-true or from true-to-false depending on the type of TIMER instruction used. The DN bit is the most commonly used timer status bit. On-Delay Timer (TON) The on-delay timer (TON) is a nonretentive output instruction used when the application requires an action to occur at some time after the rung conditions for the timer become true. The ControlLogix TON on-delay instruction and timer selection toolbar are shown in Figure 15-50. When you want to use a timer, you must create a tag of type TIMER (it is a predefined data type) and enter the preset and the accumulated value. The tag must be defined before the preset and accumulated values can be entered. A value can be entered for the accumulator while programming. When the program is downloaded this value will be in the timer for the first scan. If the TON timer is not enabled the value will be set back to zero. Normally zero will be entered for the accumulator value. The timer tag name is declared using the new tag properties dialog box shown in Figure 15-51. Tag name, description (optional), tag type, data type, and scope are selected or typed to complete the validation. A descriptive tag name, such as Solenoid_Delay, makes it easier to know what function the timer serves in the control system. The program of Figure 15-52 is an example of a 10000 ms (10 s) TON timer. Timers generate both word level (DINT) and bit level (BOOL) data and status. The operation of the program can be summarized with reference to the Monitor Tags window. • The status of all instruction is shown after the timer input switch has been switched from off to on (1) and accumulated 5000 ms (5 s) of time. • At this halfway point the EN bit is 1 since the rung is true, the TT bit is 1 since the accumulated value is Diverter gate solenoid delay timer TON TIMER ON DELAY Timer Preset Accum Solenoid_Delay Figure 15-51  Timer tag validation. 3000 0 EN DN changing, and the DN bit is 0 since the accumulated value does not yet equal the preset value. • When the ACC equals PRE, the accumulated value stops incrementing, EN stays on for as long as the rung remains true, TT equals 0 since the accumulated value is not changing, and DN equals 1 since ACC 5 PRE. • This will result in the DN pilot light switching on at the same time as the TT pilot light switches off. • The EN pilot light remains on as long as the input switch is closed. • Opening the input switch at any time causes the TON instruction to go false, resetting the counter ACC value to 0 and EN, TT, and DN bits to 0. This in turn switches off all output pilot lights. • The TON instruction is a self-resetting timer. When the rung goes false, the timer is automatically reset. A reset instruction can be used, but usually is not. Figure 15-53 shows a TON timer used to delay the operation of a diverter gate solenoid for 3 seconds after a target has been sensed by the solenoid energize sensor. The operation of the program can be summarized as follows: • Detection of the target causes closure of the SOL_ Energize_Sensor contacts, making the timer rung true and start timing. • With passage of the target, the SOL_Energize_Sensor contacts open but the rung remains true through the EN bit of the TON timer. • After 3000 ms (3 s) delay time has elapsed, delay TON TOF RTO CTU CTD RES Favorites Add-On Alarms Bit Timer/Counter Tag name Input side of rung TON TIMER ON DELAY Timer Preset Accum Solenoid_Delay 3000 0 EN DN Figure 15-50  TON on-delay instruction. timer DN bit is set to 1 to energize the SOL_Gate. Programming Timers  Part 3 359


Petruzella_ProgrammableLogicControllers__5e
To see the actual publication please follow the link above