> ## Documentation Index
> Fetch the complete documentation index at: https://instro.nominal.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Modbus RTU

> A connection type for [`ModbusDevice`](/library/protocols/modbus)

<Card title="Modbus RTU" horizontal href="/library/protocols/modbus/ModbusRTU">
  <img src="https://mintcdn.com/nominal/vd1fIohbHX0IE-nH/snippets/drivers/modbus/modbus-rtu/image.png?fit=max&auto=format&n=vd1fIohbHX0IE-nH&q=85&s=73178de4f0aec88de51006b0397975bf" style={{ width: "100%", height: "100px", objectFit: "contain" }} noZoom alt="Modbus RTU" width="600" height="191" data-path="snippets/drivers/modbus/modbus-rtu/image.png" />
</Card>

Modbus RTU is a connection type for [`ModbusDevice`](/library/protocols/modbus), not a separate driver class: set `"transport": "rtu"` in the config's connection block, or pass a `ModbusRTUTransport` explicitly. The Python code is identical to Modbus TCP; only the connection block changes.

## Creating a [`ModbusDevice`](https://nominal-io.github.io/instro/protocols/modbus/#modbusdevice) over RTU

```json theme={null}
{
  "version": 1,
  "protocol": "modbus",
  "device": {
    "name": "field_sensor",
    "description": "RS-485 field temperature sensor"
  },
  "connection": {
    "transport": "rtu",
    "port": "/dev/ttyUSB0",
    "baudrate": 9600,
    "parity": "N",
    "stopbits": 1,
    "bytesize": 8,
    "timeout": 2.0,
    "unit_id": 1
  },
  "registers": [
    {
      "name": "temperature",
      "starting_address": 0,
      "register_type": "input",
      "data_type": "float32",
      "poll": true
    }
  ]
}
```

```python theme={null}
from instro.modbus import ModbusDevice

device = ModbusDevice(config="field_sensor.json")
device.open()
```

Parameters and methods specific to [`ModbusDevice`](https://nominal-io.github.io/instro/protocols/modbus/#modbusdevice) can be found in the [SDK](https://nominal-io.github.io/instro/).
