Contents: | Introduction Features and benefits |
The industrys serial de facto standard since 1979, Modbus introduced by MODICON GOULD (USA), continues to enable millions of automation devices to communicate.
Today the MODBUS protocol continues to grow, with the support of SCHNEIDER AUTOMATION (F, USA).
MODBUS is an application layer messaging protocol, positioned at level 7 of the OSI model, that provides client/server communication between devices connected on different types of buses or networks.
Source: MODBUS Application Protocol Specification V1.1 - MODBUS.ORG
The Internet community can access MODBUS at a reserved system port 502 on the TCP/IP stack.
Source: MODBUS Application Protocol Specification V1.1 - MODBUS.ORG
MODBUS is a request/reply protocol and offers services specified by function codes. MODBUS function codes are elements of MODBUS request/reply PDUs.
PLC: Programmable Logic Controller
HMI: Human Machine Interface
Source: MODBUS Application Protocol Specification V1.1 - MODBUS.ORG
The MODBUS protocol defined a simple protocol data unit (PDU) independent of the underlying communication layers. The mapping of MODBUS protocol on specific buses or network can introduce some additional fields on the application data unit (ADU).
Source: MODBUS Application Protocol Specification V1.1 - MODBUS.ORG
The MODBUS application protocol establishes the format of a request initiated by a client.
The MODBUS application data unit is built by the client that initiates a MODBUS transaction. The function code indicates to the server what kind of action to perform.
The function code field of a MODBUS data unit is coded in one byte. Valid codes are in the range of 1 ... 255 decimal (128 255 reserved for exception responses).
Sub-function codes are added to some function codes to define multiple actions.
The data field of messages sent from a client to server devices contains additional information that the server uses to take the action defined by the function code. This can include items like discrete and register addresses, the quantity of items to be handled, and the count of actual data bytes in the field.
The data field may be nonexistent (of zero length) in certain kinds request, in this case the server does not require any additional information. The function code alone specifies the action.
If no error occurs related to the MODBUS function requested in a properly received MODBUS ADU the data field of a response from a server to a client contains the data requested.
Source: MODBUS Application Protocol Specification V1.1 - MODBUS.ORG
If an error related to the MODBUS function requested occurs, the field contains an exception code that the application can use to determine the next action to be taken.
Source: MODBUS Application Protocol Specification V1.1 - MODBUS.ORG
The size of the Modbus PDU is limited by the size constraint inherited from the first Modbus implementation on Serial Line network (max. RS485 ADU = 256 bytes).
Therefore, MODBUS PDU for serial line communication = 256 - Server address (1 byte) - CRC (2 bytes) = 253 bytes.
Consequently :
RS232 / RS485 ADU = 253 bytes + Server adress (1 byte) + CRC (2 bytes) = 256 bytes.
TCP MODBUS ADU = 253 bytes + MBAP (7 bytes) = 260 bytes.
MODBUS Application Protocol V.1.1, Nov. 2002, www.modbus.org
EB Last updated on 12 May 2003