Modbus
Lesson 6.2
What Modbus Is and Why It Survived
Modbus was developed in 1979 by Modicon for communicating with programmable logic controllers. It was not designed for buildings. It predates BACnet by about 15 years.
It is still everywhere. Energy meters, VFDs, chillers, boilers, power monitors all speak it because it is simple, robust, and universally understood.
The Four Data Types
Coils (Function Code 01/05): Single-bit read/write values. The Modbus equivalent of binary outputs.
Discrete Inputs (Function Code 02): Single-bit read-only values. The Modbus equivalent of binary inputs.
Input Registers (Function Code 04): 16-bit read-only registers. The Modbus equivalent of analog inputs. Values are raw integers; you need the register map for scaling.
Holding Registers (Function Code 03/06/16): 16-bit read/write registers. The Modbus equivalent of analog outputs.
RTU vs. TCP
Modbus RTU: The original form. Runs over RS-485 serial. One master, up to 247 slaves. Each slave has a unique address.
Modbus TCP: Modbus wrapped in TCP/IP packets. Runs over standard Ethernet. Uses port 502 by default.
Reading a Register Map
A register map is the rosetta stone for a Modbus device. It tells you what address each piece of data lives at, what type it is, whether you can read/write it, and how to interpret the raw number.
The scaling is everything: Raw registers are integers. A temperature of 72.4 degrees F might be stored as 724 with a scale factor of 0.1.
Get the register map before you show up: Showing up on site without it means you cannot do the integration that day.