Page 82

Petruzella_ProgrammableLogicControllers__5e

• When the sixth part arrives the Container_Counter_ Counts counter will then be done, thereby allowing the solenoid to actuate for any container after the fifth. • The Container_Counter_Max counter will continue until the eleventh part is detected and then both of the counters will be reset. Count-Down (CTD) Counter The count-down (CTD) counter operates in a fashion opposite to the count-up CTU counter. CTD counters will cause the accumulated count to decrease instead of increase by one every time there is a false-to-true transition of the counter ladder rung. The ControlLogix CTD downcounter instruction is shown in Figure 15-73. The descriptions of the function block fields and the tag references are Tag Name Counter_1 Counter_1.PRE Counter_1.ACC Counter_1.CU Counter_1.CD Counter_1.DN Counter_1.OV Counter_1.UN CTD Tag name Count Down Counter Preset Accum Counter_1 Input side of rung CD DN Counter_1 RES Figure 15-73  Count-down CTD counter instruction. the same as those associated with the CTU function block. The CTD instruction is typically used with a CTU instruction that references the same counter structure. The application program shown in Figure 15-74 is used to limit the number of parts that can be stored in the buffer zone to a maximum of 50. A CTU counter and a CTD counter are used together with the same address to form an Up/Down counter. This is the most common type of application of the CTD counter. The different tags created to fit the program are shown in Figure 15-75. The operation of the program can be summarized as follows: • The Restart_Button is momentarily actuated at any time to reset the accumulated value of the counter to zero. • Conveyor brings parts into a buffer zone. • Each time a part enters the buffer zone, the Enter_Limit_Sw is actuated and Counter_1 increments by 1. • Each time a part leaves the buffer zone, the Exit_Limit_Sw is actuated and Counter_1 decrements by 1. • When the number of parts in the buffer zone, at any one time, reaches 50, the Counter_1.DN bit is set. • As a result the Conveyor_Contactor rung goes false to de-energize the conveyor contactor, automatically any more parts until the accumulated count drops below 50. Ladder logic program stopping the conveyor from bringing in Restart_Button <Local:1:I.Data.1> Counter_1 CTU Inputs Restart_Button Count Up Counter Counter_1 Preset Accum RES CU DN Enter_Limit_Sw <Local:1:I.Data.3> CTD Count Down Counter Counter_1 Preset Accum CD DN Exit_Limit_Sw <Local:1:I.Data.4> Counter_1.DN Conveyor_Contactor <Local:2:O.Data.2> L1 Enter_Limit_Sw Exit_Limit_Sw Conveyor_Contactor Figure 15-74  CTU counter and CTD counter used together to form an Up/Down counter. L2 Output C Programming Counters  Part 4 371


Petruzella_ProgrammableLogicControllers__5e
To see the actual publication please follow the link above