CTU — Count Up
CTU
Counter
counter
(CU)
Preset
?
(DN)
Accum
?
Increments .ACC by 1 on each rising edge of the rung. Sets .DN when .ACC reaches .PRE; keeps counting past the preset.
Operands
| Name | Type |
|---|---|
counter | COUNTER |
How It Works
| Event | .ACC | .CU | .DN |
|---|---|---|---|
| Rising edge of rung | +1 | 1 | 1 when .ACC ≥ .PRE |
| Rung stays true | unchanged | 1 | unchanged |
| Rung false | unchanged | 0 | unchanged |
RES on the tag | 0 | 0 | 0 |
CTU counts on the transition from false to true. Holding the input true does not keep counting.
Example — Parts Counter
Count boxes passing a sensor. Signal "full" at 10 boxes.
Tag setup: Boxes is a COUNTER with .PRE = 10.
XIC(BoxSensor)CTU(Boxes);XIC(Boxes.DN)OTE(BinFull);XIC(ResetBtn)RES(Boxes)
Common Mistakes
- Adding
ONSbefore aCTU— unnecessary.CTUalready counts on the rising edge. - Expecting
.DNto block further counting — it does not..ACCkeeps climbing. Add aRESor an interlock if you need to stop.
Related
- Counters overview — members, units, shared behaviour
- CTD — count-down counterpart
- RES — clears the accumulator