What is Modbus?


What is Modbus?

Modbus Protocol is a messaging structure developed by Modicon in 1979. Originally developed for use with Programmable Logic Controllers (PLCs), its easy to use, open and royalty-free publishing meant it became adopted across industry for a wide range of applications.

Modbus protocol can be thought of as a language, if two devices speak they can communicate easily. Modbus has become so popular that it is now the de facto language used for industry.

Modbus protocols are now managed by the Modbus organisation – www.modbus.org. Brainboxes has been a Modbus organisation member since 2015.

A typical application might be a SCADA controller connected to a number of remote units. In this case the SCADA interface uses Modbus to request information from the remote units, and only the remote units can provide that information. This is a master-slave or client-server example.


What is a Master-Slave/ Client-Server?

Client-Server is the same as Master-Slave. This describes the relationship between devices connected using Modbus. The Master or Client asks the questions and the Slave or Server has to return the answer within a given time.

An easy analogy for this is a restaurant where there is a Server – the Waiter, and there is a Client – the Customer. The Server comes at the Client’s beck and call and gives the Client whatever the Client asks for.

Only the Client can originate commands, like the customer placing their order.

The Server responds by supplying the requested data to the Client or by performing the action requested in the command.

You might have lots of slaves/servers connected to a controlling device, such as a computer, human machine interface (HMI) or a PLC.

How does a Master/Client ask a question?

Modbus TCP can identify devices by their unique IP address. So it can use the IP address to direct questions to the right device. When the master/client asks a question the slave/sever can look up the information in a table.

There are several types of table, holding, coil and discrete for example. Brainboxes’ Modbus firmware can use a number of different address systems. For example:

Modbus access typeSupported Modbus function codesLogical address984 style addressIEC 61131 address
Read digital inputsCoil10x0020…00033…%M32…
Read digital inputsDiscrete input20x0000…10001…n/a
Read digital inputsInput register40x002030033n/a
Read DI counter valuesInput register40x0000…30001…n/a
Read DI counter valuesHolding register30x0000…40001…%MW0…
Clear DI countersCoil5, 150x0200…00513%M512…
Set/read digital outputsCoil1, 5, 150x0000…00001…%M0…
Set/read digital outputsHolding register3, 6, 160x002040033%MW32
overload flags
Output overload flagsInput register40x040031025n/a

What are the different types of Modbus?

There are a number of Modbus variants, however these are the two most popular:

  • Modbus TCP over Ethernet
  • Modbus RTU & ASCII over serial lines RS232 or RS485

Frequently asked questions about Modbus and our Ethernet Remote IO devices (ED Range)

  • How do I get Modbus on my ED device?

    Simply download our 5.XX firmware here and upgrade.

  • Which ED devices can use Modbus TCP?

    All Brainboxes ED Range devices support Modbus TCP
    (With exception to the ED-582, ED-593 & BB-400)

  • Is Modbus software supplied with the ED device?

    The ED console that is supplied with the ED device also can be used for Modbus commands.

  • Where can I find the Modbus register tables?

    You can find them in our Modbus manual that comes on the CD with the ED device or alternatively on our website here.

  • How do I set up my ED device to work with Modbus TCP?

    Simply go onto your ED device’s webpage and change the setting from “ASCII” to “Modbus TCP” on the protocol page.

  • Does the Boost.IO android app work with Modbus?

    The Boost.IO app can be used to view and change settings of the ED device over the network, you will not be able to send Modbus commands through the Boost.IO app.

  • Can you control Modbus over the internet?

    Yes, you can connect via the IP of the device as long as port forwarding is set up correctly.

  • Will the Boost.IO API work for Modbus?

    Yes, you will need to download the latest version from NuGet, here.