The Modbus protocol does not define the physical layer. Instead it uses RS-232C compatible serial interfaces, which are very common on microcontrollers.
- Coil: Discrete output (e.g. digital GPIO output pin on microcontroller)
- Holding register: Internal, two-byte wide digital register that are used for storing values
Messages start with a colon (:) and end with a carriage return-line feed pair (CR-LF). Each byte of data between is sent as ASCII-encoded HEX (0-9, A-F).
The common function codes are shown in the below table.
|01||Read coil status|
|02||Read input status|
|03||Read holding registers|
|04||Read input registers|
|05||Force single coil|
|06||Preset single register|
|07||Read exception status|
|15||Force multiple coils|
|16||Preset multiple registers|
|17||Report slave ID|
FreeMODBUS – A Modbus ASCII/RTU and TCP implementation: Software targeted at embedded platforms.
free-dotnet-modbus: A free .NET implementation of the Modbus protocol.
ModNet: Free Windows-based Modbus protocol client, which checks Modbus RTU compliance.
Posted: December 14th, 2012 at 2:26 pm
Last Updated on: July 5th, 2017 at 12:15 pm