Interval Test
LogicThe IntervalTest block tests whether an incoming scalar input signal lies within a defined numerical interval . The boundary limits (, ) and their open/closed inclusivity (both, lower only, upper only, neither) are fully configurable. Depending on whether the condition is met, the block outputs either a fixed numerical constant or passes the input signal through directly. This makes it ideal for safety limit monitors, safe operating area (SOA) checks, window comparators, and conditional deadband passthroughs without needing complex boolean networks.
Mathematical Model
The interval inclusion condition is evaluated according to the inclusive mode:
where is lowerLimit and is upperLimit.
The block output is then determined by the condition result:
where the true and false branch outputs are configured by their respective result modes:
with and .
Inputs & Outputs
| Direction | ID | Label | Type | Status |
|---|---|---|---|---|
| → In | in |
In | number | Required |
| ← Out | out |
Out | number | Output |
Parameters
| Parameters | Label | Type | Default | Description |
|---|---|---|---|---|
lowerLimit |
Lower Limit | number | -1 |
|
upperLimit |
Upper Limit | number | 1 |
|
inclusive |
Inclusive Bounds | select | both |
|
trueResultMode |
True Output | select | constant |
|
trueValue |
True Constant | number | 1 |
|
falseResultMode |
False Output | select | constant |
|
falseValue |
False Constant | number | 0 |
Usage Examples
Example 1: Battery Cell Temperature Safe Operating Area (SOA) Monitor
Monitoring lithium-ion battery temperature in an electric vehicle Battery Management System (BMS). Setting lowerLimit = 0.0 (), upperLimit = 45.0 (), inclusive = "both", trueResultMode = "constant" with trueValue = 1.0, and falseResultMode = "constant" with falseValue = 0.0. A downstream logic switch immediately cuts off fast charging whenever cell temperature exits the safe window.
Example 2: Linear Window Passthrough with Clamped Zero Out-of-Bounds
Synthesizing a linear bandpass filter window that allows small perturbation signals through while blanking extreme disturbances. Setting lowerLimit = -5.0, upperLimit = 5.0, inclusive = "both", trueResultMode = "input", and falseResultMode = "constant" with falseValue = 0.0. Inputs inside pass through unchanged (), while values outside are suppressed cleanly to zero.
Remarks & Best Practices
- Input Passthrough Flexibility: The
trueResultModeandfalseResultModeoptions allow dynamic gating of physical signals without requiring downstream Switch or Multiplexer blocks. - Inverted Limit Boundary Condition: If
lowerLimit > upperLimit, the resulting interval is empty, causing the block to evaluate false and emit for all finite inputs. - Ideal Driver for Logical Switches: In standard boolean mode ( for true, for false), the output directly drives the control input of
SwitchandRelayblocks. - Zero Computational Overhead: Evaluated directly as native scalar comparison instructions in WebAssembly with zero memory allocations or iteration loops.
Related Components
- Comparator: Evaluates single-threshold relational comparisons (, , etc.).
- DeadZone: Suppresses signals within a central deadband while shifting values outside.
- Switch: Selects between two alternative input signals based on a threshold condition.
- Saturation: Clamps a dynamic signal to remain within lower and upper limits.