CTU_DINT
PROGRAM CTU_DINT_DEMO VAR BOOL1,BOOL2,BOOL3: BOOL; DINT1,DINT2: DINT; FB:CTU; END_VAR FB(CU:=BOOL1,R:=BOOL2,PV:=DINT1,Q=>BOOL3,CV=>DINT2); END_PROGRAM
The block acts as a counter counting up from zero to the preset value pv.
| Input | Type | Description | Default value |
| CU | BOOL | Rising edge counts one up | False |
| R | BOOL | Sets the counter to zero | False |
| PV | DINT | Final value of the counter | 0 |
| Output | Type | Description |
| Q | BOOL | State when the counter finished counting (counting finished: q=true). |
| CV | DINT | Current value of the counter |