Page 83

Petruzella_ProgrammableLogicControllers__5e

Tag Name Value Style Data Type Counter_1 Counter_1.PRE Counter_1.ACC Counter_1.CU Counter_1.CD Counter_1.DN Counter_1.OV Counter_1.UN { . . . } 50 0 0 0 0 0 0 0 Decimal Decimal Decimal Decimal Decimal Decimal Decimal Decimal COUNTER DINT DINT BOOL BOOL BOOL BOOL BOOL Restart_Button Enter_Limit_Sw Exit_Limit_Sw Conveyor_Contactor 0 0 1 Decimal Decimal Decimal BOOL BOOL BOOL BOOL Combining Counter and Timer Functions Figure 15-76 shows a bottle flow rate program implemented using a Logix controller. This program is designed to indicate how many bottles pass a given process L1 Inputs O On Start_Switch Start_Switch <Local:1:I.Data.0> Start_Switch <Local:1:I.Data.0> Start_Switch <Local:1:I.Data.0> Bottle_Sensor 372 Part 4  Programming Counters point per minute. The operation of the program can be summarized as follows: • When the Start_Switch is closed, both the timer and counter are enabled. • The Total_Bottles counter is pulsed for each bottle that passes the Bottle_Sensor. • The counting begins and the 1_Min_Timer starts timing through its one minute (60000 milliseconds) time interval. • At the end of one minute, the timer done bit (DN) causes the counter rung to go false. • Sensor pulses continue but do not affect the Total_ Bottles counter. • The number of bottles for the past minute is represented by the accumulated value of the Total_Bottles counter. • The sequence is reset by momentarily opening and closing the Start_Switch. Figure 15-75  Tags created for the Up/Down counter program. 1_Min_Timer.DN Figure 15-76  Bottle flow rate program. Bottle_Sensor <Local:1:I.Data.1> TON Timer On Delay Timer Preset Accum 1_Min_Timer 60000 0 EN DN Total_Bottles RES Count Up Counter Preset Accum Total_Bottles 0 0 CTU CU DN Ladder logic program


Petruzella_ProgrammableLogicControllers__5e
To see the actual publication please follow the link above