Modbus RTU Knowledge

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.

 

Protocol Specifications

 

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.
    Read More

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.
    Read More

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#.
    Read More

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.
    Read More

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.
    Read More

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.
    Read More

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.
    Read More

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.
    Read More

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.
    Read More

 

MK10 and 32 Bits Numbers

 

Reading Vendor Modbus Maps

 

Other Related Articles:

 

External Links

 

If you liked this post;
  • Please consider subscribing to our RSS feed