Count Up Down
easy
Bidirectional counter with separate Up and Down inputs that tracks 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'.
Inputs and outputs
| Tag | Type | Default | Description |
|---|---|---|---|
| In_Up | BOOL | — | — |
| In_Down | BOOL | — | — |
| Sts_Count | DINT | — | 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.