Page 389 - Programmable Logic Controllers, Fifth Edition - Mobile version
P. 389
L1 Input Ladder logic program Output L2
Container_Sensor
<Local:1:I.Data.2> CTU
Count Up CU
Container_Sensor
Counter Container_Counter_Counts
Preset DN SOL
Accum
CTU
Count Up CU
Counter Container_Counter_Max
Preset DN
Accum
Container_Counter_Max.DN Container_Counter_Counts
RES
Container_Counter_Max
RES
Container_Sensor SOL
Container_Counter_Counts.DN <Local:1:I.Data.2> <Local:2:O.Data.2>
Sensor
Solenoid
Figure 15-71 CTU program used to remove containers from a conveyor line.
• The Increment_PL controlled by the Package_ Tag Name Value Style Data Type
Counter.CU status bit turns on and off as each bot- Container_Counter_Counts {...} COUNTER
tle passes to show that the counter is incrementing. Container_Counter_Counts .PRE 6 Decimal DINT
• When the accumulated value of the counter is 24 Container_Counter_Counts .ACC 0 Decimal DINT
the DN bit of the counter is set and switches on the Container_Counter_Counts .CU 0 Decimal BOOL
Preset_Reached_PL. Container_Counter_Counts .CD 0 Decimal BOOL
Container_Counter_Counts .DN 0 Decimal BOOL
• The counter is reset by momentarily closing the Container_Counter_Counts .OV 0 Decimal BOOL
Reset_Button. Container_Counter_Counts .UN 0 Decimal BOOL
The program shown in Figure 15-71 uses two CTU in- Container_Counter_Max {...} COUNTER
structions as part of a program to remove 5 out of every Container_Counter_Max .PRE 11 Decimal DINT
10 containers from a conveyor line using an electric so- Container_Counter_Max .ACC 0 Decimal DINT
lenoid. The different tags created to fit the program are Container_Counter_Max .CU 0 Decimal BOOL
shown in Figure 15-72. The operation of the program can Container_Counter_Max .CD 0 Decimal BOOL
be summarized as follows: Container_Counter_Max .DN 0 Decimal BOOL
Container_Counter_Max .OV 0 Decimal BOOL
• The preset for the Container_Counter_Counts is set Container_Counter_Max .UN 0 Decimal BOOL
for 6 and that for the Container_Counter_Max is Container_Sensor 0 Decimal BOOL
set to 11. SOL 0 Decimal BOOL
• When the container is detected both counters will Figure 15-72 Tags created for the CTU program used to
increase their accumulated values by 1. remove containers from a conveyor line.
370 Part 4 Programming Counters
pet73842_ch15_333-394.indd 370 03/11/15 7:33 PM