Modbus: In simple terms

Let's Introduce


The Modbus protocol is a messaging structure that was originally developed by Modicon. It is a serial communication protocol (remember I said serial not cereals!). The modbus interface is good and simple to implement and hence, is widely accepted. Communication between the Modbus nodes is achieved by messages. Modbus has now became the de facto standard for industrial communication networks.

The Message Structure

Its communication interface is built around messages. The formats of these modbus messages are independent of type of physical interface used. The structure of each Modbus message is the same. There are four basic parts of each message. These are:
Element Description
Device Address This is the address of the reciever (Slave)
Function Code
This code defines the message type.
Data It contains additional information.
Error check Value to test for communication errors
The sequence of these parts (i.e. the order in which they occur) is the same for all messages, so that the Modbus message is easier to parse. The Master starts the conversation in Modbus. The master sends a message and depending upon the contents of the message, the slave takes action and responds to it. There can be more than one masters in the Modbus network. The device address is used to define which device should respond to this message. All other nodes in the network ignore this message if the address field doesn't match their own address.
But, a point to note here is that the master can address individual slaves or can broadcast a message to all slaves together but the slaves do not respond to a broadcast message.


  • The master initiates request that consists of the function code and data request.
  • The slave performs the requested action and initiates the response.
  • The master receives the response.
The messages exchanged between the master and the slave are called frames. There is a set of 4 data types used in the Modbus transactions. These are:

  • The discrete input type is a single bit object type and is read-only.
  • The coil type is a single bit object type and is read-write.
  • The input registers type is a 16 bit word and is read-only.
  • The holding registers type is a 16 bit word and is read-write.

The Transmission Modes of a Modbus Network

Standard Modbus Networks employ two kinds of Transmission Networks:
  • \RTU Mode
  • ASCII Mode

    Comments

    Popular Posts