Faq For Modbus

Modbus industrial communication protocol

Modbus is an open industrial application-layer communication protocol used to exchange data between PLCs, HMIs, SCADA systems, motor drives, meters, sensors and many other automation devices. Originally introduced by Modicon in 1979, Modbus can operate over serial networks as Modbus RTU or Modbus ASCII and over Ethernet networks as Modbus TCP.

In simple terms: Modbus gives industrial devices a common way to ask for and exchange information. One device can request a register value, read an input or write a command while another device returns the requested information. Modbus defines the message and data model; the electrical wiring may be RS-485, RS-232 or Ethernet depending on the implementation.

What is Modbus?

Modbus is one of the longest-established protocols within industrial communication. Its basic operation follows a request-and-response model: a client sends a request containing a function code and data, and the server processes that request and returns the appropriate response.

Current Modbus terminology uses client for the device initiating a request and server for the device responding to it. Older PLC, drive and Modbus RTU manuals frequently use the terms master and slave for the same general relationship, so both sets of terminology may be encountered when servicing existing equipment.

A PLC can read the operating frequency of a drive, an HMI can display holding-register values from a controller, and a SCADA system can collect process information from many Modbus devices.

Is Modbus only a serial communication protocol?

No. Describing Modbus only as a serial protocol is incomplete. Modbus defines an application-layer messaging protocol. The physical and transport layers underneath it depend on the implementation.

On serial networks, Modbus is commonly used over RS-485 in RTU or ASCII mode. Older point-to-point systems may use RS-232. On Ethernet networks, Modbus TCP carries Modbus application messages using standard Ethernet and TCP/IP.

This distinction is important during troubleshooting. A device may have a perfectly healthy RS-485 electrical connection while communication still fails because the two devices are using different protocols, serial settings or register maps.

What is Modbus RTU?

Modbus RTU — Remote Terminal Unit is the most widely encountered serial form of Modbus. It transmits the message in a compact binary format and uses CRC — Cyclic Redundancy Check for frame error detection.

A simplified Modbus RTU request contains the server address, a function code, the required data field and the CRC. Timing between characters and frames is also important because silent intervals are used to determine message boundaries on the serial line.

Modbus RTU and RS-485 should not be treated as interchangeable terms. RS-485 defines the electrical signalling interface, while Modbus RTU defines the serial message format and protocol behaviour that may operate over it.

What is Modbus ASCII?

Modbus ASCII represents each message byte using two ASCII characters. This makes the serial message easier to inspect manually, but it also requires more characters to carry the same amount of information than Modbus RTU.

An ASCII message starts with a colon character and ends with a carriage-return/line-feed sequence. Modbus ASCII uses LRC — Longitudinal Redundancy Check for error checking, whereas Modbus RTU uses CRC.

RTU and ASCII can represent the same Modbus data model and function codes, but their serial framing and error-checking methods are different. Both ends of the communication link must therefore use the same serial mode.

What is Modbus TCP?

Modbus TCP carries Modbus application messages over TCP/IP and Ethernet. A conventional Modbus TCP server normally listens on TCP port 502.

Instead of the serial address and CRC arrangement used by Modbus RTU, a Modbus TCP message contains an MBAP Header — Modbus Application Protocol Header. This header includes a Transaction Identifier, Protocol Identifier, Length and Unit Identifier.

The Transaction Identifier allows a client to associate a response with the corresponding request. A separate Modbus RTU CRC is not appended to the Modbus TCP application message because the Ethernet/TCP communication stack provides its own lower-layer integrity mechanisms.

Many modern PLCs, remote I/O systems and drives support Modbus TCP directly. For a comparison with another major Ethernet-based protocol, see EtherNet/IP vs Modbus TCP.

How do Modbus clients and servers communicate?

Modbus fundamentally uses a request/response transaction. The client sends a request identifying the required operation and data address. The server either performs the requested operation and returns a normal response or returns an exception response when the request cannot be completed.

On a serial Modbus network, normal server addresses range from 1 to 247. Address 0 is reserved for broadcast requests. A server does not normally return a response to a serial broadcast request.

Modbus TCP devices also have normal IP addressing. Where a TCP-to-serial gateway is used, the Unit Identifier in the MBAP header can be used to identify a downstream serial device behind the gateway.

What are Modbus coils and registers?

The Modbus data model defines four basic data areas. Coils are single-bit values that can be read and written. A logical output state is a common example.

Discrete Inputs are single-bit read-only values. A limit switch, proximity sensor or digital status signal may be represented in this area.

Input Registers are 16-bit read-only registers in the Modbus data model. A measurement obtained from an industrial sensor or transmitter may be presented through input registers, depending on the manufacturer's register map.

Holding Registers are 16-bit values that can normally be read and written. A variable frequency drive may place speed references, control words or adjustable parameters in holding registers.

Are 40001 and the actual Modbus register address the same thing?

Not necessarily. References such as 0xxxx, 1xxxx, 3xxxx and 4xxxx are traditional documentation conventions used to identify Modbus data areas. For example, 4xxxx is normally associated with holding registers.

A Modbus frame does not necessarily transmit the literal number “40001.” The function code already identifies the data area, while the protocol data field contains the relative address or offset.

Manufacturers and software packages can also display register addresses using zero-based or one-based addressing. As a result, a register documented as 40001 may need to be entered as 0, 1 or 40001 depending on the software being used.

This address-offset issue is one of the most common reasons a Modbus connection appears to work while the expected data cannot be found.

What is a Modbus function code?

A function code tells the server which operation the client wants to perform. Common function codes include 01 Read Coils, 02 Read Discrete Inputs, 03 Read Holding Registers, 04 Read Input Registers, 05 Write Single Coil, 06 Write Single Register, 15 Write Multiple Coils and 16 Write Multiple Registers.

A device supporting Modbus is not required to implement every possible function code. A meter may provide mainly read functions, while a motor drive may permit both reading and writing of selected control and parameter registers.

If a valid Modbus request cannot be carried out, the server can return an exception response. Codes such as Illegal Function, Illegal Data Address and Illegal Data Value are extremely useful during commissioning because they show that communication exists even though the request itself is not acceptable.

How are 32-bit and floating-point values transferred over Modbus?

A standard Modbus register contains 16 bits. Larger values such as 32-bit integers and IEEE-754 floating-point numbers therefore commonly occupy two consecutive registers.

Modbus defines the register structure, but manufacturers do not all arrange multi-register values in the same word order. Two registers may need to be interpreted as ABCD, CDAB or another byte/word arrangement depending on the device.

If a register can be read but the displayed number is obviously incorrect, check the data type, signed/unsigned interpretation, scaling factor and byte/word order before assuming that the Modbus link itself has failed.

Do devices from different manufacturers automatically work together over Modbus?

No. Modbus provides a common communication language, but it does not force every manufacturer to use the same register map. Each device manufacturer decides which value is assigned to which register, how it is scaled and which function codes are supported.

A PLC from one manufacturer can communicate successfully with a VFD from another over Modbus RTU, but the PLC program still has to use the drive manufacturer's actual register addresses and data formats.

The same applies to HMI panels, temperature controllers, energy meters and process transmitters. “Both devices support Modbus” is a starting point for integration, not a guarantee that plugging them together will produce useful data automatically.

Why is Modbus still widely used?

Modbus has remained popular because the protocol is relatively simple, its specifications are openly available and an enormous range of industrial equipment supports it. It can also be used in both simple serial networks and Ethernet-based systems.

The protocol originally developed by Modicon is now maintained through the Modbus Organization. Its widespread adoption means that a modern automation system can still encounter Modbus devices ranging from simple meters to PLCs, drives and SCADA gateways.

Its popularity does not mean that Modbus is the ideal protocol for every application. Highly synchronized multi-axis motion, large structured device profiles or more demanding built-in security requirements may favour other industrial communication technologies.

Is Modbus secure?

Classic Modbus and conventional Modbus TCP were not designed with the authentication and encryption mechanisms expected from modern secure networks. A Modbus TCP server on port 502 should therefore not simply be exposed directly to the public Internet.

Modern industrial cybersecurity should use appropriate segmentation, firewalls, controlled remote access and other network-security measures around Modbus systems.

The Modbus Organization has also defined Modbus Security, which uses TLS and X.509 certificates and reserves TCP port 802. This does not mean that ordinary installed Modbus TCP devices automatically support the secure variant.

Can standard Modbus be used for emergency stop or functional safety?

Standard Modbus should not be treated as a functional-safety protocol. It is suitable for ordinary control commands and process-data exchange, but emergency-stop and certified safety functions require an appropriate safety architecture.

A motor drive may receive a normal run or stop command through Modbus, but this should not automatically be substituted for a certified safety function such as safe torque off or an appropriately designed emergency-stop circuit.

Why does Modbus communication fail?

The first step is to determine whether the problem is at the physical layer, communication-settings layer or register/data layer. On an RS-485 system, reversed conductors, poor topology, incorrect termination, baud-rate mismatch or parity mismatch can prevent communication.

Once the physical link is correct, verify the server address, function code and requested register. Duplicate serial addresses or attempts to read unsupported registers can produce failures even when the cable itself is perfect.

On Modbus TCP, check IP addressing, subnet configuration, TCP port access and the device's allowed server connections. A successful ping confirms IP reachability, but it does not prove that the Modbus TCP service is running or correctly configured.

If communication works but the value appears wrong, check the register offset, zero/one-based addressing, signed versus unsigned interpretation, floating-point format, word order and scaling factor. Many apparent “communication faults” are actually data-mapping problems.

Practical Modbus troubleshooting checklist

1. Are both devices using the same Modbus type: RTU, ASCII or TCP?

2. On a serial system, is the electrical interface RS-485 or RS-232 and is it wired correctly?

3. Do baud rate, parity, data bits and stop bits match?

4. Are serial server addresses valid and unique?

5. Is the correct function code being used?

6. Has the register address been interpreted correctly as zero-based or one-based?

7. Are 32-bit and floating-point values using the correct byte and word order?

8. Is the server returning a Modbus exception response?

9. For Modbus TCP, are the IP configuration and TCP port 502 reachable?

10. Is the actual problem in the cable, protocol settings or only the device register map?

Related Modbus and Serial Communication Guides

Modbus RS-485 · Modbus ASCII · EtherNet/IP vs Modbus TCP · Ethernet

Related Automation Pages

PLCs · HMI Panels · SCADA · AC Drives and VFDs · Sensors · Industrial Communication


Refine Search