Compare Input » History » Revision 2
Revision 1 (Adam Klama, 06/21/2026 02:14 PM) → Revision 2/3 (Adam Klama, 06/21/2026 03:05 PM)
# Compare Input ## Overview A **Compare Input** produces a **boolean** by comparing a source input against a value. The result follows the standard convention: **true = 1024, false = 0**. Use it to turn a measurement into an on/off condition — for example "oil pressure is below the warning limit" or "speed is inside the shift window" — that other logic, outputs or maps can act on. ## Prerequisites You need: - A **source input** to compare — any existing input, referenced by its alias. - The **value** to compare against. This can be a fixed number, or you can point the source/value at a [Constant Value Input](Constant_Value_Input) Input](Constant-Value-Input.md) if you want a tunable threshold. ## Add it in the app 1. Add a new input and choose **Compare Input** as the type. 2. Choose the **source input**. 3. Give it a clear **alias** (e.g. `Low Oil Pressure`). 4. Set the **compare mode**, the **value**, and a **deviation** for hysteresis. 5. Enable the **filter** and set the debounce timings if the result still chatters. ## Settings reference > Schema: `config/CompareInput.proto`. | Setting | Meaning | Unit | Range / values | Notes | |---|---|---|---|---| | **Source input** | The input being compared | — | an existing input (by alias) | The value tested against **Value**. | | **Compare mode** | How the comparison is made | — | `Equal`, `LessThan`, `GreaterThan`, `WindowCompare` | See below. Result is `1024` (true) or `0` (false). | | **Value** | The value to compare against | source's unit | int32 | The threshold/reference point for the comparison. | | **Deviation** | Hysteresis band around the threshold | source's unit | int32 | Adds hysteresis so the result doesn't chatter as the source crosses **Value** — it switches at one edge of the band and clears at the other. (In `WindowCompare` it also sets the half-width of the in-range window.) | | **Enable filter** | Turns on debounce of the boolean result | — | on / off | Recommended when the source hovers near the threshold. The three timings below apply when on. | | **Delay** | Time the new result must be stable before it is accepted | ms | sint32 | Suppresses brief flips around the threshold. | | **Hold** | Minimum time a result is held once accepted | ms | sint32 | Stops rapid re-triggering. | | **Interspace** | Minimum gap between result changes | ms | sint32 | Ignores changes that arrive closer together than this. | **Compare modes:** `Equal`, `LessThan` and `GreaterThan` test the source against **Value**. `WindowCompare` is true while the source sits **within `Value ± Deviation`** — handy for "in range" checks. **Hysteresis vs debounce:** **Deviation** is the first defence against chatter — it gives the threshold a dead-band so the result doesn't flip rapidly as the source hovers around **Value**. The **Delay / Hold / Interspace** debounce timings are a time-based backup if the result still chatters. ## Common settings Compare Input also uses the shared setting — alias. See [Common IO Settings](Common_IO_Settings). Settings](../Common-IO-Settings.md). ## Example — low oil-pressure warning 1. Type **Compare Input**, alias `Low Oil Pressure`. 2. **Source input** = your `Oil Pressure` input. 3. **Compare mode** `LessThan`, **Value** `100` (your low-pressure limit), **Deviation** `10` so it trips below 90 and clears above 110 (hysteresis). 4. Optionally **Enable filter**, **Delay** `200`, **Hold** `500` so a momentary dip does not trip the warning. The input now reads `1024` (true) whenever oil pressure is below the limit, `0` otherwise. ## Troubleshooting - **Result chatters on/off:** increase **Deviation** for more hysteresis; if it still flips, enable the **filter** and raise **Delay** / **Interspace**. - **Always true or always false:** check the **compare mode** and that **Value** is in the same units as the source input. - **Window Compare never true:** **Deviation** is too small, or **Value** is not the centre of the band you expect. ## Related - [Constant Value Input](Constant_Value_Input) Input](Constant-Value-Input.md) — a tunable threshold to compare against. - [Math / Divide Input](Math_Divide_Input) Input](Math-Divide-Input.md) — derive a value to compare. - [Counter Input](Counter_Input) Input](Counter-Input.md) — count how often a compare result fires.