3technical data – Lenze RS-485 module User Manual

Page 5

Advertising
background image

3

ENGLISH

3

ENGLISH

Technical Data

3

Technical data

3.1

Related documents

MODBUS Application Protocol Specification V1.1
It can be found at:

http://www.modbus.org/default.htm

MODBUS over Serial Line Specification & Implementation guide V1.0

3.2

General Modbus protocol description

The MODBUS protocol defines a simple protocol data unit (PDU) independent of the underlying
communication layers.
There are some additional data unit (ADU) fields introduced by the network layer

ADU

1 Byte Address

1 Byte Function Code

Data

2 Bytes CRC

PDU

Figure 3: RS485 Network MODBUS frame

The client (also named Master) that initiates a MODBUS transaction builds the MODBUS application
data unit. The function indicates to the server what kind of action to perform. The MODBUS
application protocol establishes the format of a request initiated by a client.
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). When a message is sent from a Client
to a Server device the function code field tells the server what kind of action to perform.
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. If an error related to the MODBUS
function requested occurs, the field contains an exception code that the server application can use to
determine the next action to be taken.
For example a client can read the ON / OFF states of a group of discrete outputs or inputs or it can
read/write the data contents of a group of registers.
When the server responds to the client, it uses the function code field to indicate either a normal
(error-free) response or that some kind of error occurred (called an exception response). For a normal
response, the server simply echoes the original function code.

Advertising