Modbus is a communications protocol based on master/slave or client/server architecture, designed by Modicon for use with its PLCs. It has become a standard wherever Industrial Automation Systems (IAS) or Building Management Systems (BMS) needed. The main reason for the extensive use of Modbus over other communications protocols is the fact that it is openly published, it’s relatively easy to implement and reliable.
Modbus comes in a variety of flavors, RTU and ASCII. Both of these procols are serial (RS232 or RS485) based.
- Modbus RTU is a compact, binary representation of the data.
- Modbus ASCII is human readable, and more verbose.
- Modbus Application Protocol Specification V1.1a
- Modbus Messaging Implementation Guide V1.0a
- Modbus Messaging Implementation Guide V1.0b
- Modbus Serial Line Implementation Guide V1.0
- Modicon Modbus Protocol Reference Guide PI–MBUS–300 Rev. J (Modbus 300)
Frequently Asked Questions (FAQ)
How are real (floating point) and 32-bit data encoded in Modbus RTU messages?
- The Modbus RTU protocol itself was designed based on devices with a 16-bit register length. Consequently, special considerations were required when implementing 32-bit data elements. This implementation settled on using two consecutive 16-bit registers to represent 32 bits of data or essentially 4 bytes of data. It is within these 4 bytes of data that single-precision floating point data can be encoded into a Modbus RTU message.
Why are 7 data bits bad for Modbus RTU?
- Modbus RTU is a binary protocol. It requires the use of all 8 bits in each character / byte that forms the message because there are many situations where the 8th bit is used.
Can I create a Modbus Client using C#?
- You should be able to write a Modbus client in any language that has access to the serial ports or a TCP connection. C# has access to both the serial port and a RAW TCP connection, therefore it should not be too hard to create a simple Modbus Client with C#.
What is the minimum subset of functions that a Modbus slave device should implement?
- If you are creating a Modbus Slave device that will only be interrogated by a specific Modbus Master, then you only have to implement the functions that the Modbus Master will use to call on your Modbus Slave.
- If you are creating a commercially available Modbus Slave device there are 4 so called classes of function implementation.
What is a ModHopper wireless transceiver?
- The ModHopper wireless transceiver is a premier, low-cost product for building automation applications developed by the Obvius Corporation that supports Modbus and pulse equipment (i.e. sensors, meters, etc.) along with related networks. The ModHopper transceiver is best suited for energy monitoring in either industrial or commercial structures.
Where can I find more Modbus developer resources?
- The internet offers a wide variety of sites related to Modbus development from personal to commercial sites. One major resource site is the main Modbus website. Another great resource is our own Modbus Protocol Specification. Read more for a breakdown of the tools offered on the official Modbus website.
How can I convert 16-bit numbers to 32-bit numbers in Modbus?
- FieldServer provides 4 functions to convert Modbus 16 bit numbers to 32 bit numbers. These functions take two 16 bits numbers to form one 32 bit number, and each function processes the bytes in a different order.
How can I connect multiple clients to a Modbus slave?
- The solution is to use a multi-port FieldServer. Connect each client to its own port and the slave(s) to thier own ports. Each client will see a single virtual slave(s) on its network. This not only solves the problem but is extremely efficient. Of course the FieldServer needs to be correctly configured.
How do I test for a connection between my Modbus device and my personal computer?
- There are a few free utilities to check communications between your PC and your Modbus device. A quick search on Google for “Free Modbus Slave utilities” should give you a list of utilities to chose from. You can also try using our own CAS Modbus Scanner. It’s free and very easy to use.
MK10 and 32 Bits Numbers
Reading Vendor Modbus Maps
Other Related Articles:
- CAS Modbus Explorer
- Converting Modbus 16 bit numbers to 32 bit numbers
- FieldServer Technologies ProtoCessors
- Free Tool: CAS Modbus Scanner
- How Real (Floating Point) and 32-bit Data is Encoded in Modbus RTU Messages
- Modbus: Create a Modbus client in C#
- Modbus Developer Resources
- Modbus: Minimum Function Implementation
- Modbus/TCP to BACnet/IP Configuration Sample
- Modbus: Testing Modbus communication
- Modbus Transaction Identifier
- Moxa MB3000 Series Gateways
- Multiple Clients of a Modbus slave
- Obvius ModHopper Transceiver
- Scaling / Bit Packing
- Useful tools and applications for Modbus
- Using The CAS Modbus Scanner to Read Modbus 6 Digit Address (Also Known As JBUS)
- Utilizing Modbus Scanner to Write Registers of Digitrip 3000 (Protective Relays) Controls
- Why 7 data bits is no good for Modbus RTU