]> git.giacomolli.uk - onehouse/blob - doc/m31.rst
a1b6eeaa93f9edded98abba95d8e65998e9bed3e
[onehouse] / doc / m31.rst
1 ###############
2 Ebyte M31 I/O
3 ###############
4
5 The ``driver/m31`` package defines one host and up to fifteen expansion
6 modules. A module's slice index is its slot. The host has eight digital
7 inputs and eight digital outputs. Mixed expansions add eight of each,
8 input expansions add sixteen inputs, output expansions add sixteen
9 outputs, and analog expansions add eight voltage outputs.
10
11 Each point uses ``m{slot}.di{channel}``, ``m{slot}.do{channel}``, or
12 ``m{slot}.ao{channel}``. Inputs, coils, and analog registers have
13 independent zero-based address ranges that continue across modules.
14 Analog registers represent zero through ten volts as zero through 10000.
15 Hardware pulse widths are whole milliseconds from 50 through 65535.
16 Their width registers start at ``0x30d4`` and their output-mode
17 registers start at ``0x32c8``, both indexed by coil address. Mode zero
18 is level control and mode one is pulse control.
19
20 Descriptors use manufacturer ``ebyte`` and firmware ``unknown``. The
21 package does not read the host identity registers. Pulse capabilities
22 accept commands but do not report transient coil state. Input
23 capabilities are read-only.
24
25 Tests verify topology and descriptor values without a physical module.
26 They do not confirm physical expansion limits or relay timing under
27 load. The conservative sixteen-module limit includes the host.
28
29 ***************
30 Modbus client
31 ***************
32
33 ``NewTCPClient`` supplies a caller-owned, serialized connection through
34 ``Client``. Connect selects the configured unit and has a two-second
35 timeout. A request has a one-second write deadline and a two-second
36 response deadline, both measured from its start. Caller deadlines and
37 cancellation can stop it earlier. Each response must match the
38 transaction, unit, function, length, and write acknowledgement.
39 Supported functions are 01, 02, 03, 05, 15, and 16. No external Modbus
40 package is required.
41
42 In-memory stream tests check request bytes, response validation,
43 exceptions, truncation, cancellation, and timeouts. They do not verify a
44 physical host or TCP network behavior.