EM58 – HS58 - HM58 MODBUS TCP/IP
The
MODBUS Response PDU
is defined as {function_code, response_data},
where:
function_code = MODBUS function code [1 byte];
response_data = this field is function code dependent and usually contains
information such as variable references, variable counts, data offsets, sub-
function, etc. [n bytes].
The
MODBUS Exception Response PDU
is defined as {exception-
function_code, exception_code}, where:
exception-function_code = MODBUS function code + 0080 hex [1 byte];
exception_code = MODBUS Exception code, refer to the table “MODBUS
Exception Codes” in the section 7 of the document “MODBUS Application
Protocol Specification V1.1b”, [1 byte].
The size of the MODBUS PDU is limited by the size constraint inherited from the
first MODBUS implementation on Serial Line network (max. RS-485 ADU = 256
bytes).
Therefore:
MODBUS
PDU for serial line communication
= 256 - Server address (1 byte) -
CRC (2 bytes) = 253 bytes.
Consequently:
RS-232 / RS-485
ADU
= 253 bytes + Server address (1 byte) + CRC (2 bytes) =
256 bytes
.
TCP MODBUS
ADU
= 253 bytes + MBAP (7 bytes) =
260 bytes
.
6.5 Function codes
As previously stated, the function code indicates to the Server what kind of
action to perform.
The function code field of a MODBUS Protocol Data Unit is coded in one byte.
Valid codes are in the range of 1 … 255 decimal (the range 128 … 255 is
reserved and used 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. Function code “0” is not valid.
There are three categories of MODBUS function codes, they are:
•
public function codes
;
•
user-defined function codes
;
•
reserved function codes
.
Public function codes
are in the range 1 ... 64, 73 ... 99 and 111 ... 127; they
are well defined function codes, validated by the MODBUS-IDA.org community
and publicly documented; furthermore they are guaranteed to be unique.
Ranges of function codes from 65 to 72 and from 100 to 110 are
user-defined
function codes
: user can select and implement a function code that is not
supported by the specification, it is clear that there is no guarantee that the use
of the selected function code will be unique.
Reserved function codes
are not available for public use.
MAN EM58_HS58_HM58 MT E 1.1.odt
MODBUS® TCP/IP interface 38 of 104
Summary of Contents for EMC58 MT
Page 101: ...This page intentionally left blank ...
Page 102: ...This page intentionally left blank ...