Ethernet Communications Modules, 3rd Edition, Rev. D
5-3
Chapter 5: MODBUS TCP for H0/H2/H4-ECOM100
1
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D
This header provides some differences compared to the Modbus RTU application data unit
used on serial line:
• The Modbus “slave address” field usually used on Modbus Serial Line is replaced
by a single byte “Unit Identifier” within the MBAP Header. The “Unit Identifier”
is used to communicate via devices such as bridges, routers and gateways that
use a single IP address to support multiple independent Modbus end units.
• All Modbus requests 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 sufficient. For function codes carrying a variable
amount of data in the request or response, the data field includes a byte count.
• Protocol Identifier - It is used for intra- system multiplexing. The
Modbus protocol is identified by the value 0. (2 bytes)
The
function code field
of a message contains 8 bits. Valid function codes are in the range of 1
- 255 decimal. The function code instructs the slave what kind of action to take. Some examples
are to read the status of a group of discrete inputs; to read the data in a group of registers; to
write to an output coil or a group of registers; or to read the diagnostic status of a slave.
When a slave responds to the master, it uses the function code field to indicate either a normal
response or that some type of error has occurred. For a normal response, the slave echoes the
original function code. In an error condition, the slave echoes the original function code with
its MSB set to a logic 1.
The
data field
is constructed using sets of two hexadecimal digits in the range of 00 to FF.
According to the network’s serial transmission mode, these digits can be made of a pair of
ASCII characters or from one RTU character.
The data field also contains additional information that the slave uses to execute the action
defined by the function code. This can include internal addresses, quantity of items to be
handled, etc.
The data field of a response from a slave to a master contains the data requested if no error
occurs. If an error occurs, the field contains an exception code that the master uses to determine
the next action to be taken. The data field can be nonexistent in certain types of messages.
Содержание H0-ECOM
Страница 1: ...HX ECOM Manual Manual Number HX ECOM M...