Skip to content

v0.2.0

Latest

Choose a tag to compare

@GraysonBellamy GraysonBellamy released this 30 May 19:03
· 7 commits to main since this release
v0.2.0
59afafa

anymodbus 0.2.0

Adds Modbus-ASCII framing, FC08 diagnostic loopback, FC04
input-register typed reads
, and RS485 cold-start ergonomics — the
capabilities requested by servomexlib for its [modbus-ascii] / AUTO
milestone. The public API is additive and backwards-compatible; the internal
framing layer was restructured behind a narrow Framer strategy seam so
RTU / ASCII / (future) TCP share one response interpreter.

Added

  • Modbus-ASCII framingBus(stream, framing=Framing.ASCII), the
    Framing enum, and an open_modbus_ascii(path, *, baudrate, parity, data_bits=8) opener (data_bits=7 for the classic 7E1 wire). Sync mirrors
    included.
  • Pure LRC primitives at anymodbus.lrc: lrc8, lrc8_bytes,
    verify_lrc (mirroring anymodbus.crc).
  • FC08 diagnostic loopbackSlave.diagnostic_loopback(data=b"\x00\x00")
    (FC 0x08 sub-0x0000, Return Query Data), a side-effect-free liveness probe.
  • FC04 input registers in the typed readsread_float / read_int32 /
    read_string accept source=RegisterSource.INPUT (default HOLDING).
  • TimingConfig.startup_settle — one-shot pre-first-transaction settle for
    USB-RS485 adapter warm-up.
  • ChecksumError base exception (parent of CRCError and new LRCError).
  • MockSlave parity — answers FC08 sub-0 and speaks ASCII
    (MockSlave(framing=…), client_slave_pair(framing=…)).

Changed

  • Default RetryPolicy.retry_on widened to {ChecksumError, FrameTimeoutError} so ASCII LRCError retries by default (RTU unchanged —
    CRCError ⊂ ChecksumError).
  • FC 0x08 reclassified from known-unsupported to supported (sub-0 only).
    CRCError reparented under ChecksumError (still a ProtocolError).

No breaking changes to the documented public API. Full changelog in
CHANGELOG.md.