< All Topics
Print

Modbus TCP

Modbus TCP is a widely used communication protocol for industrial and IoT devices. It enables communication between a master (usually a computer or controller) and one or more slave devices (such as sensors or controllers) over a TCP/IP network.

What is Modbus TCP?

Modbus TCP is an Ethernet-based version of the Modbus protocol.
It uses a client-server architecture.
Communication occurs over port 502.
It supports reading and writing to data areas called:


Holding Registers (HR) – for configuration and text fields
Input Registers (IR) – for sensor readings
Discrete Inputs (DI) – for digital status flags

Decoding Text in Holding Registers

Holding Registers store ASCII strings as 16-bit values. Each 16-bit register (2 bytes) stores two ASCII characters:

High byte → First character
Low byte → Second character

When decoding:

Convert each 16-bit register into two 8-bit bytes.
Strip padding bytes like 0x00 (null characters).

Example:
Uint16Array.from([0x4865, 0x6C6C, 0x6F00])

Index Hex High Byte Low Byte Characters
0 0x4865 0x48 = 'H' 0x65 = 'e' He
1 0x6C6C 0x6C = 'l' 0x6C = 'l' ll
2 0x6F00 0x6F = 'o' 0x00 = \0 o

Holding Registers


Input Registers

PropertyStart AddressSizeDescriptionFriendly NotationLegacy Address
Temp1 (×10)01Temperature Probe 1IR[0]30001
Temp2 (×10)11Temperature Probe 2IR[1]30002

Discrete Inputs

PropertyStart AddressSizeDescriptionFriendly NotationLegacy Address
Door1Open01Door 1 statusDI[0]10001
Reserved1–77UnusedDI[1–7]10002–10008
LightRelay81Light RelayDI[8]10009
Reserved91UnusedDI[9]10010
HeaterDoor1101Heater Door 1DI[10]10011
Reserved11–133UnusedDI[11–13]10012–10014
ExternalAlarm141External AlarmDI[14]10015
Reserved15–162UnusedDI[15–16]10016–10017
PowerFail171Power FailDI[17]10018
Panic181PanicDI[18]10019
Door1Opened191Door 1 Opened AlarmDI[19]10020
Reserved201UnusedDI[20]10021
Room1Installed211Room 1 InstalledDI[21]10022
Room2Installed221Room 2 InstalledDI[22]10023
Reserved231UnusedDI[23]10024
TempProbe1NotGood241Temp Probe 1 Not GoodDI[24]10025
HighTempProbe1251High Temp Probe 1 AlarmDI[25]10026
LowTempProbe1261Low Temp Probe 1 AlarmDI[26]10027
TempProbe2NotGood271Temp Probe 2 Not GoodDI[27]10028
HighTempProbe2281High Temp Probe 2 AlarmDI[28]10029
LowTempProbe2291Low Temp Probe 2 AlarmDI[29]10030
Reserved30–4516UnusedDI[30–45]10031–10046
Wifi461WiFi StatusDI[46]10047
Reserved471UnusedDI[47]10048
Server481Server ConnectionDI[48]10049
Bluetooth491Bluetooth StatusDI[49]10050
BatteryNotGood501Battery Not GoodDI[50]10051
Reserved51–555UnusedDI[51–55]10052–10056

Access ModBus – Cloud Configuration

  1. Log in to your account

2. Click on device you want to configure

3. Click on “Modbus” button near the device card, under “Program” button

4. A configuration window will appear, providing detailed information and settings for the Modbus client.

Recommended Software

  1. Windows – Mod 32/64 Based on your operating System https://www.modbustools.com/download.html
  2. MAC – QModMaster/ModPoll – https://www.modbusdriver.com/modpoll.html
  3. Web – Node.js + jsmodbus or modbus-serial
Topics