BlockWerk 文档
⊂

Interval Test

Logic

测试输入信号是否落在指定的数值区间内。如果位于区间内默认输出 1,如果在区间外则输出 0。

在 BlockWerk 中仿真

浏览器即开即用的交互式仿真环境 — 无需安装,由 WebAssembly 强力驱动。

在 BlockWerk 中仿真 →

数学模型

y={1,L≤u≤U0,otherwisey = \begin{cases} 1, & L \le u \le U \\ 0, & \text{otherwise} \end{cases}

其中 L 为区间下限,U 为区间上限。各边界的闭合包含性可通过参数 inclusive 进行配置(both、lower、upper、neither)。

输入与输出

Direction ID Label 类型 Status
→ In in In number Required
← Out out Out number Output

参数

参数 Label 类型 默认值 描述
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

使用示例

  • 安全容限监控:监测反应器温度是否保持在 60 °C 至 80 °C 之间,若超出范围则触发安全报警。
  • 窗口鉴相器/鉴幅器:仅在系统压力位于正常工作带内时允许驱动执行机构。

说明与最佳实践

  • 布尔逻辑输出:默认输出 1(区间内)或 0(区间外);适合用作开关(Switch)或逻辑门方块的条件控制信号。
  • 边界包含性:inclusive 参数精确定义了比较关系是严格不等还是非严格不等。
  • 极限情况:当 lowerLimit = upperLimit 时,仅在 both 模式下方块可能输出 1。
  • 计算性能:计算开销极低;无需维护历史状态或内存。

相关模块

  • Comparator:单阈值比较器
  • DeadZone:死区内输出为零,死区外输出偏移值的方块