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.
| Language | iec 61131 3 |
|---|---|
| Code | CTU |
| Group | Counter |
| Syntax | CTUInst( CU := VarBOOL1, RESET :=VarBOOL2 , PV := VarWORD1); |
| Dialect | CODESYS |
| Name | Data type | Description |
|---|---|---|
| CU | BOOL | Rising edge: Incrementing CV by one |
| RESET | BOOL | TRUE: Reset CV to 0 |
| PV | WORD | Upper limit for incrementing |
| Q | BOOL | TRUE if CV >= PV |
| CV | WORD | Current counter value |