Modbus communication protocol was developed in 1979, and almost 40 years later, it is still used on many industrial sites. It is pretty cool that this openly published, free, simple protocol has been adopted by so many manufacturers to exchange information.
It passes 16-bit words over a network that can be formatted however the manufacturer sees fit (unsigned, signed, real), as long as the master and the slave device have agreed ahead of time what format the word(s) will take.We can have a 1,600 ton chiller made by one manufacturer, a VFD controlling the speed of an enormous fan made by a different manufacturer, and a PLC made by yet another manufacturer all on the same network. It is impressive to me that all these devices can communicate, and be controlled seamlessly, by just sending a few words over a primitive RS-485 network.
- Four (4) types of data can be passed. The first digit of the entity number defines the data type.
- Read/Write words. These entity numbers span from 40001 to 49999.
- Read-Only words. These entity numbers span from 30001 to 39999.
- Read/Write bits. These entity numbers span from 00001 to 09999.
- Read-Only bits. These entity numbers span from 10001 to 19999.
- The traditional Modbus protocol assumed you would only ever need 9999 of each type of data. The types above are all in 5-digit format, using 9999 entities each. As the use of Modbus has evolved, manufacturers have started using all 65,535 entities that the protocol supports. When entities higher than 9999 are exchanged, the protocol uses 6-digit formatting, so 40001 becomes 400001; 49999 becomes 409999. An integrator views 49999 and 409999 the same. The software dictates which format is supported.
- Modbus can be used on a Serial RS-232 or Serial RS-485 (half or full duplex) networks, called “Modbus RTU” or “Modbus ASCII”. Like all serial communication, the data bits, parity, and stop bits, along with baud rate must match at both ends.
- Modbus RTU (Remote Terminal Unit) uses 8 data bits.
- Modbus ASCII uses 7 data bits.
- Modbus can also be used on an Ethernet network called “Modbus TCP”.
- There is a difference between “entity number” and “entity address”. This is what many people find frustrating. A Modbus Master could use the entity number, while the Modbus Slave could use the entity address, or visa-versa. I seem to spend a lot of time adding and subtracting “1”. Entity number 40001 is actually entity address 0. Some manufactures, who use this protocol, list the data in their manuals by entity number and some by entity address.
- For instance, you may have a chiller, whose manual says that the cooling setpoint is register “2”. Obviously a setpoint needs to be read/write, so this may mean that it is in entity number 40002 or 40003.
- On the other hand, you may have a chiller, whose manual says that the Condenser Head Pressure is register “56”. This may be stored in a read-only register or read/write register in the chiller, so this may mean that it is in entity number 30056, 30057, 40056 or 40057. It’s fun; kind of like a mini treasure Hunt.
What to consider when setting up Modbus communication
- How does your PLC number the registers?
- In newer Modicon PLCs (using Unity Software) the PLC register type uses the entity address instead of the entity number:
- In older Modicon PLCs the registers are the same as the entity numbers (40001, 30001, 00001, and 10001).
- %MW0 = 40001, %MW99 = 40100
- %IW0 = 30001
- %M0 = 00001
- %I0 = 10001
- In an Allen Bradley Micrologix PLC, you could have:
- N7:0 = 40001, N7:99 = 40100
- N8:0 = 30001
- B9:0 = 00001
- B10:0 = 10001
- How do you change network types?
- I find many instances where I have a Modicon PLC on Ethernet that needs to talk to a 3rd party device over RS-232 or RS-485. Group Schneider makes a gizmo called a “ConneXium Ethernet Gateway”, part number TSXETG100.
- I have also used many RS-232 to RS-485 converters and find the one manufactured by B&B Electronics, part number 485LDRC9, to be bulletproof and easily configurable for any serial network.
So, we are still using Modbus because it is cheap and simple. Apparently device manufacturers still think serial communication is the way to go, so I assume Modbus RTU will continue to be used for quite some time. Now that many manufacturing facilities are putting everything on Ethernet, and Modbus TCP talks over Ethernet, this protocol is here to stay.
About the Author
Julie Gruenholz is a Senior Control Systems Engineer for Hallam-ICS. As an Electrical Engineer, she has been designing, installing, modifying and programming control systems since 1991.
Read My Hallam Story
Hallam-ICS is an engineering and automation company that designs MEP systems for facilities and plants, engineers control and automation solutions, and ensures safety and regulatory compliance through arc flash studies, commissioning, and validation. Our offices are located in Massachusetts, Connecticut, New York, Vermont and North Carolina and our projects take us world-wide.