Modbus – the basics

Modbus is an open communication protocol used to transmit signals from instrumentation and control devices back to a main controller or data gathering system.

 

It is freely available for use by any manufacturer and is royalty free.  Due to this, and it’s inherent simplicity and reliability, it has been adopted by many equipment suppliers, and has become a very popular and widely used communication protocol throughout many industries.

 

There are two types of Modbus devices, a Modbus Master that controls activity on the data bus by sending out data requests or write information, and the Modbus slaves that listen to requests and supply the information needed. The Slave devices do not initiate communication, they only respond to a request from the Master.

 

In a standard Modbus network, there will be one active Master and up to 247 Slaves.  Each slave will be identified uniquely with an I.D. number from 1 to 247.

 

The Slave devices are active at all times measuring / gathering information depending upon their function, measurement of level, pressure, temperature etc. The information they measure is stored within their own memory in a register array. This is divided into separate predetermined address maps within the device.

 

To obtain the required information, the Modbus Master will broadcast a request for specific information from the network including the relevant Slave devices unique I.D. and the address maps of the required information.

Depending upon the complexity of the Slave device it can hold significant amounts of information but by requesting specific address maps only the relevant information is collected, speeding up the process. The Master repeats this request to each Slave and collects all data needed.

 

The Master can be configured with a collection routine that interrogates different data on each cycle, ensuring that critical information is collected and updated rapidly, whereas less important or dynamic data is collected every few cycles.

The Master can also be configured to request data from an Address range so that multiple fields can be read from a Slave device for a single request.

 

The Modbus Master can write information to the Slave devices, allowing remote rescaling / changing of calibration constants or even complete remote configuration of a new / replacement device.

For security all the data packets sent and received include a checksum. This is a value derived from the actual size of the data packet. Both Master and Slave devices evaluate the data packet against its checksum before accepting it as valid. In the event of data corruption the Master will retry, the number of retries can be varied to suit the actual purpose of the network.

 

Modbus is transmitted over serial cables between devices. As applied by PSM this serial cable connection is in the form of an RS485 twisted pair cable.

The data itself is sent in binary form, as series of ones and zeroes called bits. Each bit is sent as a voltage pulse. Zeroes are sent as positive voltages and Ones as negative. These bits may be sent at high speed. The transmission speed PSM uses is 9600 baud (bits per second), which has been proven to provide the best combination of rapid update rates and minimum failures/retries, in the environments our equipment is typically employed.