CODESYS CTU

CTU is a function block that increments a counter value. A rising edge on CU increases CV by one, RESET=TRUE sets CV to 0, and PV sets the upper limit for incrementing. Output Q is TRUE when CV is greater than or equal to PV.

Source checked18/18 values · 2026-10-26

Specification

2 sources
Languageiec 61131 3
CodeCTU
GroupCounter
SyntaxCTUInst( CU := VarBOOL1, RESET :=VarBOOL2 , PV := VarWORD1);
DialectCODESYS

Parameters

NameData typeDescription
CUBOOLRising edge: Incrementing CV by one
RESETBOOLTRUE: Reset CV to 0
PVWORDUpper limit for incrementing
QBOOLTRUE if CV >= PV
CVWORDCurrent counter value
↑↓ navigate↵ openesc close