Back to FBD reference

Counters

CTU

Count-up counter

The CTU block increments an internal counter on rising edges of CU. When R is active, the counter resets to 0.

Typical FBD symbol

CU
R
CTU
Q
Typical FBD symbol for CTU

Inputs

NameTypeRequiredDescription
CUBOOLYesCount-up input. Rising edges are counted.
RBOOLYesReset current count to 0.

Outputs

NameTypeRequiredDescription
QBOOLYesTRUE when count has reached PV.

Parameters

NameTypeRequiredDefaultDescription
PVnumberNo1Preset count value.

Stateful

Yes, the block keeps internal state between scans.

Behavior rule

Counts rising edges on CU; when R = TRUE resets count to 0; Q = TRUE when count >= PV.

Practical use

  • stop a conveyor after counting the required number of boxes.

What to watch

  • Keeping CU constantly TRUE and expecting a count on every scan. CTU counts signal edges.
  • Confusing CTU reset with CTD reset: CTU R returns the count to 0.

Related blocks