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