EM58 – HS58 - HM58 MODBUS TCP/IP
•
FUNCTION CODE
: the function code indicates to the Server what kind
of action to perform. The function code is followed by a
DATA
field that
contains request and response parameters. All MODBUS request and
responses are designed in such a way that the recipient can verify that a
message is finished. For function codes where the MODBUS PDU has a
fixed length, the function code alone is enough. For function codes
carrying a variable amount of data in the request or in the response, the
data field includes a byte count. For any further information on the
implemented function codes refer to the “6.5 Function codes” section on
page 38.
•
DATA
: the
DATA
field of messages contains the bytes for additional
information and transmission specifications that the Server uses to take
the action defined by the
FUNCTION CODE
. This can include items such
as discrete and register addresses, the quantity of items to be handled,
and the count of actual data bytes in the field. The structure of the
DATA
field depends on each
FUNCTION CODE
(refer to the “6.5
Function codes” section on page 38).
The complete MODBUS TCP/IP Application Data Unit is embedded into the data
field of a standard TCP frame and sent via TCP to
registered port 502
, which is
specifically reserved for MODBUS applications. MODBUS TCP/IP Clients and
Servers listen and receive MODBUS data via port 502.
NOTE
MODBUS uses a ‘big-Endian’ representation for addresses and data items. This
means that when a numerical quantity larger than a single byte is transmitted,
the most significant byte (MSB) is sent first. So for example:
Register size
value
16–bit
1234hex
the first byte sent is 12hex, then 34hex
6.4 MODBUS PDUs
The MODBUS protocol defines three PDUs. They are:
•
MODBUS Request PDU
;
•
MODBUS Response PDU
;
•
MODBUS Exception Response PDU
.
The
MODBUS Request PDU
is defined as {function_code, request_data},
where:
function_code = MODBUS function code [1 byte];
request_data = this field is function code dependent and usually contains
information such as variable references, variable counts, data offsets, sub-
function, etc. [n bytes].
MAN EM58_HS58_HM58 MT E 1.1.odt
MODBUS® TCP/IP interface 37 of 104
Summary of Contents for EMC58 MT
Page 101: ...This page intentionally left blank ...
Page 102: ...This page intentionally left blank ...