monitor_changes
Monitor only value changes in OT points: polls a reference, applies deadband, and returns timestamped changes with hard limits, across OPC-UA, Modbus, S7, and more.
Instructions
[READ][risk=low] Capture only the value CHANGES of a point over a bounded window.
Polls ``ref`` and returns only the changes (with timestamps), not every
sample — the OT deadband-report pattern. Works across OPC-UA / Modbus / S7 /
Mitsubishi MC / EtherNet/IP. Hard-capped by duration_s and max_changes (never
an infinite loop).
Args:
ref: Point to watch — OPC-UA node id, Modbus address, S7 address string,
MELSEC device, or Logix tag (per the endpoint's protocol).
endpoint: Endpoint name from config.
duration_s: Wall-clock window in seconds (1..120, capped server-side).
interval_ms: Poll interval in milliseconds (>=50).
deadband: Numeric change must exceed this to count (0 = any change).
max_changes: Stop after this many changes (1..500, capped server-side).
Returns dict: {endpoint, ref, duration_s, interval_ms, deadband, samples_polled,
change_count, changes:[{value, previous, source_timestamp, wall_clock}]}.
Example: monitor_changes(ref="ns=2;i=5", endpoint="line1", duration_s=20, deadband=0.5).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | Yes | ||
| deadband | No | ||
| endpoint | No | ||
| duration_s | No | ||
| interval_ms | No | ||
| max_changes | No |