Timer and Counter Instructions

They are output instructions that provide the same functions as would hardware timers and counters. They are used to activate and deactivate a device after an elapsed period or an expired count. These instructions are generally considered internal outputs. Like the relay-type instructions, timer and counter instructions are fundamental to the ladder diagram instruction set. The operations of timers and counters are quite similar, in fact they are both counters. A timer counts the number of times that a fixed interval of time (e.g., 0.1sec, 1.0sec) elapses. A counter simply counts the occurrence of an event. These instructions require an accumulator (ACC) register (word location) to store the elapsed count and a preset (PR) register to store a preset value and to determine the number of event occurrences or time-based intervals that are to be counted. When the accumulated value equals the preset value, a status bit is set on and can be used to turn on an output device.

The accumulated and preset values are usually stored in memory in 3-digit binary coded decimal (BCD) format. The BCD numbers can range from 000 to 999 and are stored in the lower 12 bits of a data word. Each BCD digit is represented by a 4-bit group of binary numbers. This arrangement of 1s and 0s in a group of four bits corresponds to a decimal number from 0 to 9.

Time Delay Energised (ON) (TON)

The programmed of this time delay ON timer instruction is to provide delayed action or to measure the duration for which some event is occurring. When there is any rung path has logic continuity, the timer begins counting time-based intervals and counts until the accumulated (ACC) time equals the preset (PR) value as long as the rung conditions remain true. When the accumulated time equals the preset value, a timer DONE bit in the accumulated word is set to 1. Whenever the rung logic conditions for the TON instruction go false, the accumulated value is reset to all zeros.

Timer Off Delay (TOF)

As the name implied, this output instruction is programmed to provide time delayed action. If logic continuity is lost, the timer begins counting time-based intervals until the accumulated time equals the programmed preset value. When the accumulated time equals the preset time, the output is de-energized, and the timed bit (bit 15) is set to zero. The timed contact can be used throughout the program as a NO or NC contact. If logic continuity is gained before the timer is timed out, the accumulator word is set to zero.

Retentive ON-Delay Timer (RTO)

This instruction is used for the timer to retain accumulated value when necessary, even if logic continuity or power is lost. The timer begins counting time-based intervals when there is logic continuity of the timer rung path, until the accumulated time equals the preset value. Then an output is energized, and the timed out contact associated with the output is turned ON. The timer contacts can be used throughout the program as a NO or NC contact. The retentive timer accumulator value must be reset by the retentive timer reset instruction.

Retentive Timer Reset (RTR)

The retentive timer reset output instruction is used to reset retentive timer accumulator. If any rung path has logic continuity, then the accumulated value of the retentive timer with the same word address is reset to zero.

Up-Counter (CTU)

The up-counter output instruction will increment by one each time the counted event occurs. A control application of a counter is to turn a device ON or OFF after reaching a certain count. The up-counter increments its accumulated value each time the up-count logic input makes an OFF-to-ON transition. Since only the false-to-true transition causes a count to be accepted, the rung condition must go from true to false and back to true before the next count is registered.

Counter Reset (CTR)

The counter reset output instruction reset the up- and down-counter accumulated values. When programmed, the CTR coil is given the same reference address as the CTU and CTD coils. The preset and accumulated values are displayed on the ladder diagram, but they have no real function. If the CTR rung condition is TRUE, the counter with the same address will be cleared.

Down-Counter (CTD)

The down-counter output instruction will count down by one each time a certain event occurs. Each time the down-count event occurs, the accumulated value is decremented. In normal use, the down-counter is used in conjunction with the up-counter to form an up/down counter.