CompareScalar
A family of comparison operators that evaluate a numeric input against a threshold value, producing a boolean output.
Operators
| Type | Condition | Parameters |
|---|---|---|
| CompareGT | x > value | value |
| CompareLT | x < value | value |
| CompareGTE | x >= value | value |
| CompareLTE | x <= value | value |
| CompareEQ | |x - value| <= tolerance | value, tolerance (default 0.0) |
| CompareNEQ | |x - value| > tolerance | value, tolerance (default 0.0) |
Configuration
{ "id": "gt1", "value": 42.0 }
{ "id": "eq1", "value": 10.0, "tolerance": 0.1 }
Ports
- Input Port 0: NumberData
- Output Port 0: BooleanData (true if condition holds, false otherwise)
Operation
Each input value is evaluated against the condition and a boolean result is emitted with the same timestamp.
| Time | Input | CompareGT (value=5.0) | CompareLT (value=5.0) |
|---|---|---|---|
| 1 | 3.0 | false | true |
| 2 | 5.0 | false | false |
| 3 | 7.0 | true | false |
Error Handling
- Throws if receiving invalid message types