dedicated input output sockets

This commit is contained in:
2026-03-03 17:25:38 -05:00
parent cec6ef8882
commit 0e26557247
3 changed files with 239 additions and 167 deletions

View File

@@ -123,7 +123,7 @@ arnold/
__init__.py
module_types.py ModuleType frozen dataclass + 44-module registry
config.py YAML loader, validation, dual address space computation
terminator_io.py Modbus TCP driver, signal cache, dual-space poll thread
terminator_io.py Modbus TCP driver (dual-connection), signal cache, poll thread
sequencer.py Sequence engine: timing, digital+analog set/check/wait
api.py FastAPI app: REST endpoints, static file mount for web UI
@@ -139,13 +139,13 @@ web/
YAML config ──► config.py ──► module_types.py (resolve part numbers)
terminator_io.py
┌─ TerminatorIO (Modbus TCP client per device)
FC02 read discrete inputs (digital)
│ FC04 read input registers (analog)
FC05/FC06 write single coil/register
│ FC15/FC16 write multiple coils/registers
└─ _PollThread (daemon, reads FC02+FC04 each cycle)
terminator_io.py
┌─ TerminatorIO (two TCP connections per device)
┌─ _reader conn ── FC02 read discrete inputs (digital)
FC04 read input registers (analog)
└─ _writer conn ── FC05/FC06 write single coil/register
FC15/FC16 write multiple coils/registers
└─ _PollThread (daemon, reads via _reader each cycle)
└─ IORegistry (multi-device coordinator, signal cache)
┌────────┼────────┐
@@ -162,6 +162,14 @@ The EBC100 has two independent flat address spaces:
A digital module advances only `coil_offset`. An analog module advances only `register_offset`. They do not interfere. `config.py` computes all addresses at load time.
### Dual-connection architecture
Each `TerminatorIO` opens two independent TCP connections to the EBC100:
a **reader** (used exclusively by the poll thread for FC02/FC04) and a
**writer** (used by sequencer/API/TUI for FC05/FC06/FC15/FC16). Each has
its own lock and reconnect state. Writes never block behind poll reads,
reducing typical output actuation jitter from 535 ms to 519 ms.
### EBC100 quirks
- Returns zeros for out-of-range reads (no Modbus exception code 2)