What the Microtronics Modbus Master Library offers

Table of Contents

What is Modbus?

Modbus is a client/server (formerly master/slave) based communication protocol that has become the de facto standard in the industry. One reason for this is that it is an open protocol.

Using Modbus, a client (e.g. a rapidM2M C3xx) and several servers can be connected. Due to the broad support of the Modbus standard, a wide range of devices can be considered for the server role. The range of applications extends from the connection of simple sensors to communication with drive and motor controllers to data exchange with complex measurement and control systems.

Basically, there are two versions: One for the serial interface (RS232 and RS485) and one for Ethernet.

Three different operating modes are distinguished for data transmission:

  • Modbus RTU: transmits data in binary form, therefore good data throughput but not human readable
  • Modbus ASCII: transmits data ASCII-coded, therefore directly readable by humans, but lower throughput
  • Modbus TCP: similar to RTU, transmission in TCP/IP packets


Modbus TCP


What can the Microtronics Library do?

During the development of the Modbus Master library, emphasis was placed on universal use and the simplest possible integration into own projects.

* Returns the data requested by MBM_Read ( ) as soon as they have been sent by the Modbus server.

The library functions and handling are identical on all supported hardware platforms. The implementation of the hardware-specific features happens automatically in the background, invisible to the user, and thus ensures particular comfort.

The library currently supports the master (=client) mode for serial interfaces (RS232 and RS485). The data transmission can optionally be in the more efficient Modbus-RTU or alternatively in Modbus-ASCII format.

The following function codes for read or write access are currently supported:

Function codeObject type
01 Read Coil StatusRead individual “Coil” input
02 Read Input StatusRead individual input “Discrete Input
03 Read Holding Registers (analogue) Read “Holding Register” inputs
04 Read Input Registers(analogue) Read “Input Register” inputs
05 Write Single Coil Write single output “Coil
06 Write Single RegisterWrite single (analogue) output “Holding Register
15 Write Multiple Coils Write multiple outputs “Coils
16 Write Multiple Coils Write multiple (analogue) outputs “Holding Registers

The library can be easily integrated and used in your own projects. However, the complete source code is also available in the rapidM2M Studio.

Supported hardware

The Modbus Master library is currently supported by the following hardware platforms with the corresponding interface ports:

1)Additional external wiring necessary

Do you want to create and operate IoT apps yourself?