ConstReadonlynone: (overrides?: ModbusRetryPolicyOptions) => ModbusRetryPolicyNo retries — the library default behaviour, stated explicitly.
Useful as a base for opting individual call sites out of an application-wide policy.
Readonlypersistent: (overrides?: ModbusRetryPolicyOptions) => ModbusRetryPolicyLong-running background polling: keep trying, but stop hammering.
Backs off to a 30-second ceiling and gives up after 5 minutes of failures so a permanently dead device surfaces as an error instead of silently retrying forever.
Readonlyserial: (overrides?: ModbusRetryPolicyOptions) => ModbusRetryPolicySerial (RTU/ASCII) buses: short delays, tight ceiling.
A framing or CRC error on RS-485 is usually a collision or a noise burst, so retrying quickly is the right move; timeouts back off a little further to let a slow device finish its turnaround. Reconnects are reserved for a genuinely closed port — reopening a USB serial adapter is expensive.
Readonlytcp: (overrides?: ModbusRetryPolicyOptions) => ModbusRetryPolicyModbus/TCP: room for a TCP handshake to re-establish.
A transport error over TCP generally means the socket is gone rather than a corrupted frame, so it reconnects alongside an explicit connection close.
Retry templates for common deployments.
Each entry is a factory taking optional overrides, so a template can be used as-is or as a starting point:
None of these are applied implicitly — pick one and pipe through retryModbus.