Count Up Down
easy
Bidirectional counter tracking a running balance.
What it teaches
A counter that goes both ways — up and down. Useful for tracking running balances like 'how many parts are currently in the bin'.
Parameters
| Tag | Direction | Type | Default | Description |
|---|---|---|---|---|
| In_Up | Input | BOOL | 0 | — |
| In_Down | Input | BOOL | 0 | — |
| Sts_Count | Output | DINT | 0 | Current accumulated count |
Required behavior
- Sts_Count increases by 1 on each rising edge of In_Up.
- Sts_Count decreases by 1 on each rising edge of In_Down.