Compare Input
Applies to: IOcan · Standalone controller. What this means
Overview
A Compare Input produces a boolean — 1024 for true, 0 for false —
by testing a source input against a value. Use it to turn a measurement into a
condition that other logic, outputs or maps can act on: "oil pressure is below
the limit", "speed is inside the shift window".
Three of the four modes have hysteresis built in. The fourth does not, and it is the one people reach for first.
The signals you test this way usually arrive from the engine ECU over CAN. The ECU integrations list what each preset provides — and where a signal arrives as a pressure rather than a switch, a Compare Input is how you turn it into a condition.
Prerequisites
- A source input to test, referenced by name. It must exist and be valid —
an unassigned source raises fault
0x00C0and the input is not created. - The value to test against. To keep it tunable, compare against a Constant Value Input instead of hard-coding it.
Add it in the app
- Add a new input and choose Compare Input as the type.
- Choose the source input.
- Give it a clear name (e.g.
Low Oil Pressure). - Set the compare mode, the value and the deviation.
- Leave the filter off unless you want a one-shot event rather than a condition.
Settings reference
| Setting | Meaning | Unit | Range / values | Notes |
|---|---|---|---|---|
| Source input | The input being tested | — | an existing input | Must be assigned and valid. |
| Compare mode | How the test is made | — | Equal, LessThan, GreaterThan, WindowCompare |
Exact trip points below. |
| Value | The reference point | source's unit | int32 | Same units and scaling as the source. |
| Deviation | Hysteresis band, or half the window width | source's unit | int32 | Ignored entirely in Equal mode. |
| Enable filter | Converts the result into a one-shot event | — | on / off | Not a debouncer — see below. |
| Delay | Cycles the result must hold before the event fires | cycles (≈ ms) | sint32 | Filter only. |
| Hold | — | — | — | Inert. Accepted, then overridden by the firmware. |
| Interspace | Cycles before another event may fire | cycles (≈ ms) | sint32 | Filter only. |
What each mode actually does
| Mode | Goes true when | Goes false when |
|---|---|---|
| LessThan | source < value − deviation |
source > value + deviation |
| GreaterThan | source > value + deviation |
source < value − deviation |
| WindowCompare | value − deviation < source < value + deviation |
outside that band |
| Equal | source == value exactly |
any other value |
Three things follow from this:
- The trip point is offset by the deviation, not centred on the value.
LessThan 100with deviation10trips below 90 and clears above 110. If you want it to trip at 100, set the value to 110. WindowComparebounds are exclusive, and a deviation of0makes it permanently false — the window has no width. It also fixes its bounds when the configuration is applied, so retuning the value or deviation live does not move them.Equalis an exact integer test with no hysteresis. On a noisy or scaled analog value it will almost never be true, and when it is it will chatter. UseWindowComparefor anything measured; keepEqualfor genuinely discrete values such as a decoded gear number or a mode index.
The filter is for events, not conditions
⚠️ With the filter on, this input stops reporting a condition. It reads
1024for one cycle once the comparison has held for Delay, then0again while the comparison remains true.
Leave it off for warnings, interlocks and anything a driver reads as a state. Turn it on when you want "the moment pressure dropped below the limit" as a single event — for example to drive a Counter Input. Full behaviour: the event filter.
Deviation is the right tool for chatter, not the filter. It suppresses flicker without changing the input from a state into a pulse.
Common settings
Compare Input also uses the shared Name setting. See Common IO settings.
Example — low oil-pressure warning
- Type Compare Input, name
Low Oil Pressure. - Source input
Oil Pressure. - Compare mode
LessThan, Value110, Deviation10— trips below 100 and clears above 120. - Filter off — the warning must stay on while the pressure is low.
Example — "in the shift window"
- Source input
Vehicle Speed, Compare modeWindowCompare. - Value
600, Deviation150— true between 450 and 750, exclusive. - Filter off.
Troubleshooting
- Trips 10 % early or late: the deviation offsets the trip point. Move the value by the deviation to compensate.
WindowCompareis never true: deviation is0, so the window has zero width. It is also exclusive at both ends.Equalis never true: the source is a scaled or noisy value that never lands on exactly that integer. UseWindowCompare.- Result chatters: raise Deviation. Do not reach for the filter — it changes the input's meaning rather than steadying it.
- The result pulses once and drops out: the filter is on.
- The input does not exist: the source is unassigned — fault
0x00C0.
Related
- Constant Value Input — a tunable threshold
- Math Input — derive the value to compare
- Counter Input — count how often a comparison fires
- Common IO settings