What is Modbus?
Modbus is a serial communication protocol that was developed by Modicon in the late 1970s. Its primary purpose is to allow communication between programmable logic controllers (PLCs). The Modbus protocol is a master / slave protocol. This means one device serves as the Modbus Master - polling one or more other Modbus Slaves. The Modbus master / slave protocol is a one to many relationship where one master can connect with up to 247 slaves. The device serving as the slave waits for the master to request information from it.
There are multiple variations of the Modbus protocol. We'll talk about its serial (RS-232 or RS-485) version - Modbus RTU. It is an open protocol based on master-slave architecture. This protocol is rather popular thanks to its reliability and simplicity. It is widely implemented in Building Management Systems (BMS) and Industrial Automation Systems (IAS).
The messages sent through Modbus RTU are a simple 16-bit CRC (Cyclic-Redundant Checksum), which ensures reliability. The basic 16-bit Modbus RTU register structure is used in floating-point, tables, ASCII text, queues, etc.
As mentioned above Modbus RTU works on master-slave architecture and provides communication for devices connected via networks and buses and delivers services specified by function codes. This protocol is positioned at level 7 on the OSI model.
Modbus scanner software
To create a Modbus application data unit one has to initiate a Modbus transaction. This is a function that will inform a server what action is expected from the latter. The function code field is coded into one byte. Valid codes are from 1 to 255 bytes, with 128 to 255 reserved for exception responses.