Modbus

From Free net encyclopedia

Modbus is a communications protocol positioned at the level 7 of the OSI Model, based on master/slave or client/server architecture, designed by Modicon for use with its programmable logic controllers (PLCs). It is has become a de facto standard communications protocol in industry, and is now the most commonly available means of connecting industrial electronic devices. The main reasons for the extensive use of Modbus over other communications protocols are:

  1. it is openly published
  2. it can be implemented in days, not months
  3. it moves raw bits or words without placing many restrictions on vendors

Modbus allows for the administration of a net of devices, for example a system that measures temperature and humidity and communicates the results to a computer. Modbus is often used to connect a supervisory computer with a remote terminal unit (RTU) in supervisory control and data acquisition (SCADA) systems. Versions of the Modbus protocol exist for serial port and Ethernet.

Modbus RTU is a compact, binary representation of the data. Modbus ASCII is human readable, and more verbose. Both of these protocols are serial based. The RTU format follows the cmds/data with an checksum Cyclic_redundancy_check while the ascii format uses an Longitudinal_redundancy_check checksum. Modbus/TCP is very similar to Modbus RTU, but is transmitted within TCP/IP data packets.

An extended version, Modbus Plus (Modbus+ or MB+), also exists, but remains proprietary to Modicon. It requires a dedicated co-processor to handle fast HDLC-like token rotation. It uses twisted pair at 1 Mbit/s and has installations specs very similar to EIA/RS-485. However, it is NOT EIA/RS-485. MB+ includes transformer isolation at each node, which makes it transition/edge triggered instead of voltage/level triggered. A few EIA/RS-485 repeaters work with it by side-effect, but don't get your hopes up that you can support Modbus Plus with your computer's standard serial port.

Each device that intends to comunicate using Modbus has an unique address. Any device can send out a modbus command, although usually only one master device does so. A modbus command contains the Modbus address of the device it is intended for. Only the intended device will act on the command, even though other devices might receive it. All Modbus commands contain checking information, ensuring that a command arrives undamaged. The basic Modbus commands can instruct a RTU to change a value in one of its registers, as well as commanding the device to send back one or more values contained in its registers.

There are many modems that support modbus. Some of them were specifically designed for this protocol. Different implementations use wires, wireless communication and even SMS or GPRS. Typical problems the designers have to overcome include high latency and timing problems.

Variations:

Almost all implementations have variations from the official standard. Some of the most common variations are:

  • Data Types
    • Floating Point IEEE
    • 32 bit integer
    • 8 bit data
    • mixed data types
    • bit fields in integers
    • multipliers to change data to/from integer. 10, 100, 1000, 256 ...
  • Protocol extensions
    • 16 bit slave addresses
    • 32 bit data size (1 address = 32 bits of data returned.)
    • word swapped data

External links:

Free software exists for modbus:

de:Modbus es:Modbus fr:MODBUS pl:Modbus pt:Modbus ru:Modbus