OV – Boolean value which is set to HIGH when the counter is overflown. DN – Boolean value which is set to HIGH when the timer is finished counting. CD – Boolean value which is set to HIGH when the counter is energized to count down. CU – Boolean value which is set to HIGH when the counter is energized to count up. ACC – Integer specifying the current time value of the timer. PRE – Integer specifying up to which value the timer will count.
This value will continue to increment every single time a new product goes by. As soon as the switch detects the product, it energizes the CTU and increments the “Accum” value. This switch detects a certain product when it comes by on a conveyor belt. The CTU instruction is tied to the XIC which is energized by a proximity switch. The B3:0/14 bit is also used to RES (Reset) the C5:0 Counter.This Counter counts how many batches have been completed. The B3:0/14 bit is used to energize C5:1.The C5:0.DN bit is used to set an internal bit B3:0/14.When “Accum” of C5:0 Counter is equal to 16, the C5:0.DN bit is HIGH.The counter will continue to increment until “Accum” = 16.When the bit B3:0/16 goes LOW, followed by HIGH, the CTU instruction is energized and the counter increments again.When the bit B3:0/13 goes HIGH, the CTU instruction is energized and the counter increments the “Preset” value.The number 16 represents the number of products in a certain batch. The Counter C5:0 has a “Preset” of 16.A CTU instruction is tied to Counter C5:0.A “Product PROC Sensor ON” is indicated by an internal bit B3:0/13.A Micrologix 1100 Allen Bradley PLC is used to control a process.Here’s a real-world scenario of a CTU instruction: The CTU instruction must be paired with a way to reset the counter through a RES Instruction. It’s a widely used instruction which is extremely versatile and easy to work with. This critical element of ladder logic programming allows a programmer to keep track of how many products have passed a certain sensor, how many revolutions have been made by a certain motor, how many times a certain alarm was set and so on. Unline the Timer Instruction, the CTU will not keep incrementing until the rung is set to LOW and comes back to being HIGH. The CTU instruction will increment the “Accum” value each time the logic which leads into it is set to TRUE. The maximum counting speed of the counter is determined by the scan time, and the counter can count only when the ON/OFF period of the input condition is longer than the scan time.The CTU, also known as the Count Up, instruction is used in pair with a Counter construct to count the number of LOW to HIGH transitions of the preceding logic. The counter counts on the leading edge of the input condition of the counter imported at an input refresh. When the counter is reset by the RST instruction, the present value and contact of the counter are cleared at execution of the RST instruction.
Use the RST C instruction to clear the count value and turn off the contact.
An up counter stops counting and its contact turns on when the count value reaches the setting. The counters of the built-in PLC functions are up counters.