Project

General

Profile

Counter Input » History » Version 2

Adam Klama, 06/21/2026 03:09 PM

1 1 Adam Klama
# Counter Input
2
3
## Overview
4
A **Counter Input** keeps a running count that goes **up** and **down** as trigger
5
inputs fire. Three inputs drive it: one increments, one decrements, and one
6
resets it. Use it to tally events — shift counts, button presses, fault
7
occurrences — or to maintain a step value you nudge up and down.
8
9
## Prerequisites & hardware
10
You need up to three **trigger inputs**, each referenced by alias:
11
- An **up** input that increments the count.
12
- A **down** input that decrements it.
13
- A **reset** input that reloads the reset value.
14
15 2 Adam Klama
Triggers are typically boolean signals such as a [Compare Input](Compare_Input)
16
or a [Digital Input](Digital_Input); the counter steps on each trigger edge.
17 1 Adam Klama
Any trigger you do not need can be left unset.
18
19
## Add it in the app
20
1. Add a new input and choose **Counter Input** as the type.
21
2. Choose the **up / down / reset** trigger inputs.
22
3. Give it a clear **alias** (e.g. `Shift Count`).
23
4. Set the **step**, the **min / max** limits, the **start** and **reset**
24
   values, and whether the count **rolls over**.
25
26
## Settings reference
27
28
| Setting | Meaning | Unit | Range / values | Notes |
29
|---|---|---|---|---|
30
| **Up input** | Trigger that increments the count | — | an existing input (by alias) | Counts up by **Step** on each edge. |
31
| **Down input** | Trigger that decrements the count | — | an existing input (by alias) | Counts down by **Step** on each edge. |
32
| **Reset input** | Trigger that reloads **Reset value** | — | an existing input (by alias) | When it fires, the count jumps to **Reset value**. |
33
| **Step** | Amount added/subtracted per trigger | count | int32 | The increment size. Usually `1`. |
34
| **Min value** | Lowest the count may reach | count | int32 | Clamp limit (see **Rollover**). |
35
| **Max value** | Highest the count may reach | count | int32 | Clamp limit (see **Rollover**). |
36
| **Start value** | Count at power-up | count | int32 | The value loaded when the controller starts. |
37
| **Reset value** | Value loaded on reset | count | int32 | What the count becomes when the reset input fires. |
38
| **Rollover** | Wrap around the limits instead of clamping | — | on / off | **On:** counting past **Max** wraps to **Min** (and below **Min** wraps to **Max**). **Off:** the count stops at the limit. |
39
40
**Edge triggering:** the count changes once per trigger event, not continuously
41
while a trigger is held. At the limits, **Rollover** decides between wrapping and
42
clamping.
43
44
## Common settings
45 2 Adam Klama
Counter Input also uses the shared setting — alias. See [Common IO Settings](Common_IO_Settings).
46 1 Adam Klama
47
## Example — count gear shifts
48
1. Type **Counter Input**, alias `Shift Count`.
49 2 Adam Klama
2. **Up input** = a [Compare Input](Compare_Input) that fires on each shift.
50 1 Adam Klama
3. **Reset input** = a `Trip Reset` button input.
51
4. **Step** `1`, **Start value** `0`, **Reset value** `0`.
52
5. **Min** `0`, **Max** `999999`, **Rollover off** so it simply tallies up until
53
   reset.
54
55
## Troubleshooting
56
- **Count never changes:** check the trigger inputs actually toggle and that **Up
57
  / Down** are assigned.
58
- **Counts more than once per event:** the trigger is noisy — debounce it at the
59 2 Adam Klama
  source (e.g. the [Digital Input](Digital_Input) filter).
60 1 Adam Klama
- **Count wraps unexpectedly:** turn **Rollover off** to clamp at **Min / Max**.
61
- **Wrong value at power-up:** set **Start value**; after a reset it uses **Reset
62
  value** instead.
63
64
## Related
65 2 Adam Klama
- [Compare Input](Compare_Input) — generate the trigger events to count.
66
- [Digital Input](Digital_Input) — count switch/button edges.
67
- [Frequency Input](Frequency_Input) — measure pulse frequency/speed instead.