The CTU is an instruction that counts false-to-true rung transitions. Rung transitions can be caused by events occurring in the program. When rung conditions for a CTU instruction have made a false-to-true transition, the accumulated value is incremented by one count, provided that the rung containing the CTU instruction is evaluated between these transitions. The accumulated value is retained when the rung conditions again become false. The accumulated count is retained until cleared by a reset (RES) instruction that has the same address as the counter reset.
The control word for counter instructions includes six status bits, as indicated below.
* CU Bit: This status bit is true when UP counter instruction is true.
* DN bit: This bit is true when accumulated value is equal to or greater than the present value of the counter.
* OV(Overflow) bit: when counter count value exceeds 32,767,this bit becomes true.
* UN(Underflow):It will go true when counter counts below -32,768.
* Accumulator Value (ACC): This is the number of false-to-true transitions that have occurred since the counter was last reset.
* Preset Value (PRE): Specifies the value which the counter must reach before the controller sets the done bit.
Timing Diagram of Counter up(CTU) Instruction:
Too many uploads - please try again in an hour