Modbus TCP/RTU Device
v0.1.3MCP server for Modbus TCP/RTU devices with typed, scaled register maps and per-point limits.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
get_connection_info Get Connection Info
Report which instrument is connected (identity, address, simulated or real), whether the server is read-only, and the active safety limits. Call this first.
get_command_log Get Command Log
Return the most recent raw commands sent to / replies received from the instrument (newest last). Useful for debugging and for recording what was done.
| Parameter | Type | Description |
|---|---|---|
limit | integer |
reconnect Reconnect
Close and re-open the connection to the instrument (e.g. after it was power cycled or a cable was re-plugged).
list_points List Points
Describe the loaded register map: device, every named point (table, 0-based address, type, scaling, unit, writable, min/max, enum) and the safe-state steps. Works without a connection.
read_points Read Points
Read named points from the register map, decoded and scaled into engineering units (e.g. process_temperature = 25.1 °C). A point that cannot be read gets an `error` instead of failing the whole call.
| Parameter | Type | Description |
|---|---|---|
names | Point names from list_points; omit for all points |
read_registers Read Registers
Read raw holding or input registers (unsigned 16-bit), optionally decoded as int16, 32-bit or 64-bit values. For exploring a device; prefer read_points when a register map describes it.
| Parameter | Type | Description |
|---|---|---|
address * | integer | 0-based start address |
byte_order | string | big = standard Modbus byte order |
count | integer | Number of registers |
decode_as | string | Also decode the registers as this type |
table | string | holding (FC03) or input (FC04) |
word_order | string | 32/64-bit: big = high word first |
read_coils Read Coils
Read coils (FC01): single-bit outputs such as run/stop or relay states.
| Parameter | Type | Description |
|---|---|---|
address * | integer | 0-based start address |
count | integer | Number of coils |
read_discrete_inputs Read Discrete Inputs
Read discrete inputs (FC02): single-bit, read-only status such as alarms or limit switches.
| Parameter | Type | Description |
|---|---|---|
address * | integer | 0-based start address |
count | integer | Number of inputs |
write_point Write Point
Write a named point from the register map (setpoint, mode, output enable...). The value is checked against the point's writable flag, min/max or enum BEFORE sending, converted to raw registers, written, then read back. Changing setpoints and outputs acts on real equipment. If the write succeeds but the read-back fails, `read_back_error` says why.
| Parameter | Type | Description |
|---|---|---|
name * | string | A writable point from list_points |
value * | Engineering value (e.g. 37.5 for °C), true/false, or an enum label |
write_register Write Register
Write one raw holding register (FC06). No scaling or limits are applied, so only use it for addresses the register map does not describe (mapped addresses are refused: use write_point). Returns a read-back if the register is readable.
| Parameter | Type | Description |
|---|---|---|
address * | integer | 0-based holding-register address |
value * | integer | Raw value (negative = int16 two's complement) |
write_registers Write Registers
Write consecutive raw holding registers (FC16), e.g. both halves of a 32-bit value. No scaling or limits are applied; mapped addresses are refused (use write_point).
| Parameter | Type | Description |
|---|---|---|
address * | integer | 0-based start address |
values * | array | Raw 16-bit values |
write_coil Write Coil
Switch one raw coil (FC05). Coils often start or stop equipment (heaters, pumps, motors); mapped coils are refused here (use write_point).
| Parameter | Type | Description |
|---|---|---|
address * | integer | 0-based coil address |
value * | boolean | true = ON (0xFF00), false = OFF |