About Modbus

Home > Industries > modbus

Modbus is a commonly-used industrial communications protocol. Originally designed for Modicon (Schneider Electric) PLCs, it is now a de facto standard protocol used by many product manufacturers. Modbus uses a simple communication protocol, making it easy for even low-level devices to support. However, the simplicity of the protocol also severely limits the "plug-and-play" capability of interfaces, requiring a significant amount of 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 "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 any devices are able to communicate using Modbus.

Input Register

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 numbers, or any other data. To overcome this limitation, many register mappings will utilize two 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.

Holding Register

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.

Discrete Inputs

The discrete 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 of a concern.

Coils

Coils are read and write bits, similar to discrete inputs, but allow for a client to change the bit value. These bits are typically used for changeable parameters in a device, which allow the configuration to be changed.

For wireless Modbus functionality, please see our overview of our ModbusServer app . More Modbus information can be found at the following resources: