# CTUD

Counts upwards and downwards and signals reaching zero or a counter limit.

## Input

Name | Type | Description
--- | --- | ---
CU | BOOL | Rising edge increments counter value by 1.
CD | BOOL | Rising edge decrements counter value by 1.
R | BOOL | TRUE resets the counter value to zero.
LD | BOOL | TRUE loads start value.
PV | INT | Start value and counter limit

## Output

Name | Type | Description
--- | --- | ---
QU | BOOL | TRUE, if CV ≥ PV
QD | BOOL | TRUE, if CV = 0
CV | INT | Current counter value