Fundamentally Modbus is a layer protocol application for communication between the machines, mostly to replace data characteristic for the automation field.
At this stage Modbus is a stateless the client server protocol it is should like HTTP, according to the transactions, which be composed of a request that is issued by the client) and a response that is issued by the server. In the field where this protocol is generally implemented, there availables a model that is one of the probable schemas governing the behavior of lower level communication on a network with a common signal cable, that is Master-Slave. To avoid confusion, the below directed relations describes Master-Slave in the Client-Server paradigm terms:
• The Master is a Client
• The Slave is a Server
The communication stateless is according to an uncomplicated package, that is defined as PDU (Protocol Data Unit). The specification of protocol defines 3 types of PDU's:
• Request PDU, involving:
1. Function Code, 1 byte which is a code indicating a function
2. Function Data, bytes varying number and specific data function
• Response PDU, involving:
1. Function Code, 1 byte which is the function code equivalent to the request
2. Response Data, bytes varying number and response detailed data
• Exception Response PDU, involving:
1. Error Code, 1 byte which is the function code communicating to the request + 0 x 80 (128)
2. and Exception Code, 1 byte that is a code specifying the exception
The Functions of Modbus
The requirement defines a definite functions number, every of which is allocated a specific code of function. These are in the assortment 1-127 (decimal), as 129 (1 + 128)- 255 (127+128) corresponds to the error codes range. While the initial circulated version of the specification defined different functions classes such as Class 0; Class 1; Class 2; the recently released requirement from http://www.modbus.org describes function codes categories:
Are assured to be exclusive and identify well defined functions that are openly documented. These are authenticated by the conformance test and a community exists.
Are accessible for functions of user-defined, thus their codes may not be exclusive. The requirement defines the code ranges 65-72 and 100-110 for functions of user-defined.
These are presently utilized by some companies for heritage products and are not accessible for public use.
The function documentation as following:
1. The function description e.g. what it is fine for, it is the factors and return values including probable exclusions.
2. The Function Code assigned
3. The PDU Request
4. The PDU Response
5. The PDU Exception Response
The requirement extra documents described and allocated public functions.
Implementations of Modbus
Essentially Modbus has been applied and utilized over all physical links types such as fiber, wire, and radio and a variety of types of lower stage communication stacks. However, it will focus on the two fundamental types of implementations:
1. IP: Master or Slave
2. Serial: Asynchronous Master or Slave
Implementations of Serial Modbus
Modbus created it's life in form of an accomplishment for asynchronous communication of serial network. The level protocol of application runs directly on top of a serial communication and serial interface standards. The most common ones in excess of wire are:
• RS232 (EIA232)
RS485 can be utilized for communication of multipoint for example, multiple devices linked to the same signal cable, using the paradigm of Maste or Slave (one master and fixed address slaves).
RS232 is implemented for short distance communication of point to point, the same is suitable for RS 422, which is a RS232bidirectional extension for environments of industry.