Modbus is a commonly used industrial communications protocol. It was originally designed for Modicon (Schneider Electric) PLCs but is now a de factor standard protocol used by many product manufacturers. Modbus uses a very simplistic communication protocol, making it very easy for even low-level devices to support it well. However, the simplicity of the protocol also severely limit the "plug-and-play" capability of interfaces, requiring significant manual setup.
Modbus hardware comes in two flavors: Modbus/RTU, and Modbus/TCP. Modbus/RTU is run on top of a serial bus (RS-232 or RS-485), and is the older of the two networking methods. Modbus/TCP is slowly overtaking RTU as the preferred method, as LAN infrastructure becomes more commonplace.
A practical guide to setup
Although the Modbus protocol handles the majority of the communication details, it is critical to understand the supported "function codes" or "entities" that Modbus supports. Because Modbus has no "discovery" features, the user will need to manually configure these registers and coils before two devices will be able to functionally communicate using Modbus.
By far the most common type of entity, the input register represents a read-only value which is outputted by a sensor or device. These input registers only hold an integer from 0-65535, so they can't intrinsically represent larger numbers, floating point number, or any other data. To overcome this limitation, many register mappings will utilize 2 adjacent registers to allow larger numbers to be held, or utilize both registers (32 bits total) to represent a single precision floating point register. You will need to refer to the Modbus register map for the sensor or hardware to see what mapping method was used.
This is a read and write register, similar to the Input Register but allowing a client to write a value to it. These are typically used for changeable parameters for a device, allowing the configuration to be changed.
The descrete input is a read-only bit, which typically represents an on/off value from a sensor or device. They are used less often with modern hardware, as storage space is not as big a concern.
Coils are read and write bits, similar to descrete inputs but allowing a client to also change the bit value. These are typically used for changeable parameters for a device, allowing the configuration to be changed.