diagnose_dataflow
Localize 'no data' faults across endpoint hops. Distinguish network outages, stale values, and stuck sensors, then get a verdict and recommended action.
Instructions
[READ][risk=low] Localize a 'no data' break across an endpoint's reachable hops.
Probes connect → read(ref) → freshness → variance and returns a verdict with
per-hop detail and a recommended action. The #1 OT triage: distinguishes
"cannot connect" (network/PLC down) from "comms OK but value stale"
(upstream/field/source) from "good status but flatline" (sensor stuck).
Args:
endpoint: Endpoint name from config (any protocol).
ref: Tag/node/address/device to read (OPC-UA node id, Modbus address,
S7 address string, MELSEC device). Omit to test connectivity only.
freshness_threshold_s: Max value-age (seconds) before 'stale' (default 60).
series: Optional injected samples (scalars or {value,timestamp}) for
flatline/variance reasoning when a live historian is out of reach.
flatline_eps: Spread at/below which a series counts as flatline.
Returns dict: {verdict ('cannot_connect'|'comms_ok_value_unreadable'|
'comms_ok_bad_quality'|'comms_ok_value_stale'|'comms_ok_flatline'|
'healthy'), diagnosis, recommended_action, hops:[{hop, ok, detail}]}.
Example: diagnose_dataflow(endpoint="line1", ref="ns=2;i=5", freshness_threshold_s=30).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | ||
| series | No | ||
| endpoint | No | ||
| flatline_eps | No | ||
| freshness_threshold_s | No |