Modbus
The Modbus tab connects to a Modbus/TCP slave and reads registers and coils. With Pro you can also write holding registers and coils.
Connect
Enter the connection details and tap Connect:
- Host / IP — the device's address (e.g.
192.168.1.21) - Port — TCP port, default
502 - Unit — the Modbus unit/slave id (default
1)
BacBus remembers your last-used connection and pre-fills it next time. Tap the button again (● Connected — Disconnect) to close the connection.
Discover what's mapped
Modbus is not self-describing — a device won't tell you which registers exist. BacBus gives you two discovery tools.
Discover points
Tap 🔎 Discover points. BacBus probes each address space (holding registers, input registers, coils, discrete inputs) and reports the contiguous blocks that actually respond. Each block appears as a tappable chip showing its address range; tap it to load that block straight into the reader and read it. This is the fastest way to find real data on an unfamiliar device.
Scan unit IDs
Tap 🔢 Scan unit IDs to probe unit ids 1–32. This finds the live slaves sitting behind a Modbus TCP→RTU gateway. Tap a responding id to target it for subsequent reads.
Some devices answer every unit id with the same data (they ignore the unit id entirely). BacBus detects this and tells you so you can pick any id and move on.
Read
Configure the read and tap Read:
- Function:
- Holding Registers (FC3) — read/write registers
- Input Registers (FC4) — read-only registers
- Coils (FC1) — read/write bits
- Discrete Inputs (FC2) — read-only bits
- Start — starting address
- Count — number of values to read
- Type (registers only) — how to decode the raw registers (see below)
- Word order (32-bit types only) — byte/word ordering
Results show each value's address, the raw register words (hex) or bit, and the decoded value. A teal left stripe marks writable rows (holding registers and coils); input registers and discrete inputs are read-only.
Data types and word order
Register values can be decoded as several data types — for example uint16,
int16, uint32, int32, float32, and more. The number of registers
consumed depends on the type (a 16-bit type uses one register; a 32-bit type
uses two).
For 32-bit types, devices differ in how they order the two registers and the
bytes within them. BacBus exposes a Word order selector (e.g. ABCD,
CDAB, BADC, DCBA) so you can match the device's convention and get correct
values without guesswork.
Write (Pro)
Writing requires BacBus Pro. Only holding registers and coils are writable; input registers and discrete inputs are read-only by protocol.
Tap a writable result row to open its inline control:
- Registers — a numeric stepper with an adjustable Step, or type a value directly. BacBus encodes it using the same data type and word order the row was read with.
- Coils — an ON/OFF switch.
The value is staged — it isn't sent until you tap Write. The panel shows the previous value (and its data type) for confirmation; Reset discards the staged change. After writing, BacBus re-reads the block so the row reflects what the device actually stored.
Export (Pro)
Tap ⤓ CSV in the results bar to export the current read — address, raw, and value — and share it. CSV export requires Pro.
Modbus on an emulator
Unlike BACnet discovery (which needs a physical device for reliable UDP
broadcast), Modbus/TCP works on the Android emulator — reach a Modbus server
running on your host machine at 10.0.2.2.