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 type||Supported Modbus function codes||Logical address||984 style address||IEC 61131 address|
|Read digital inputs||Coil||1||0x0020...||00033...||%M32…|
|Read digital inputs||Discrete input||2||0x0000...||10001...||n/a|
|Read digital inputs||Input register||4||0x0020||30033||n/a|
|Read DI counter values||Input register||4||0x0000...||30001...||n/a|
|Read DI counter values||Holding register||3||0x0000...||40001...||%MW0…|
|Clear DI counters||Coil||5, 15||0x0200...||00513||%M512…|
|Set/read digital outputs||Coil||1, 5, 15||0x0000...||00001...||%M0…|
|Set/read digital outputs||Holding register||3, 6, 16||0x0020||40033||%MW32|
|Output overload flags||Discrete input||2||0x0400...||11025...||n/a|
|Output overload flags||Input register||4||0x0400||31025||n/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 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?ED-588, ED-516, ED-527, ED-538
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.