29
Table 18.2. Request frame format for the WRITE function
(frame length - 8 bytes):
address of
the device
function 6
address of the write
register from Table 20
(chapter 20)
write register value
CRC check sum
1 byte
1 byte
2 bytes (HB-LB)
2 bytes (HB-LB)
2 bytes (LB-HB)
Example 18.2.
Write in a register with address 10 (0xA) with the 0 value: 0x01 - 0x06 - 0x000A - 0x0000 - 0xA9C8
Table 18.3. Response frame format for the READ
function (minimum frame length - 7 bytes):
address of
the device
function
4 or 3
number of bytes in the
data field (max. 32*2=64B)
data field - register value
CRC check sum
1 byte
1 byte
1 byte
2
÷ 64
bytes (HB-LB)
2 bytes (LB-HB)
Example 18.3
. Response frame for register value equal to 0: 0x01 - 0x04 - 0x02 - 0x0000 - 0xB930
Table 18.4. Response frame format for the WRITE
function (frame length - 8 bytes):
copy of the request frame for the WRITE function (Table 18.2)
Table 18.5. Special answer
(errors:
function field = 0x84 or 0x83 in the case of the READ function and 0x86 in the
case of the WRITE function):
Error code
(HB-LB in the data field)
Error description
0x0001
non-existing register address
0x0002
wrong write register value
0x0003
improper function number
Example 18.5.
Error frame for a non-existing read register address:
0x01 - 0x84 - 0x02 - 0x0001 –0x5130
19. MODBUS–TCP SERIAL TRANSMISSION PROTOCOL
The MODBUS-TCP protocol is accessible to the Ethernet (RJ45) interface and uses the TCP/IP transport layer. The
parameters used by the service, to include the TCP port number, are described in chapter 12.8.
Available functions : READ - 3 or 4, WRITE - 6
Table 19.1. Request frame format of the MODBUS-TCP protocol for the READ and WRITE functions
(frame
length -12B)
Heading of the MODBUS protocol (7 bytes)
Function
code (READ
or WRITE)
register address
from Table 20
(chapter 20)
number of read registers
(1÷32) or value of read
register
Transaction and protocol
identifiers
Length field
(value = 6)
Unit identifier
4 bytes
2 bytes
1 byte
1 byte
2 bytes (HB-LB)
2 bytes (HB-LB)
Example 19.1.
Reading of a register with address 0: 0x00-0x00-0x00-0x00-0x00-0x06-0xFF-0x04-0x0000-0x0001
Table 19.2. Response frame format for the READ
function (minimum frame length - 11 bytes):
Heading of the MODBUS protocol (7 bytes)
Function
code
(READ)
number of bytes
in the data field
(2 ÷ 64)
data field - register
value (2B)
Transaction and protocol
identifiers
Length field
(maximum 67)
Unit identifier
4 bytes
2 bytes
1 byte
1 byte
1 byte
2 ÷ 64
bytes (HB-LB)
Example 19.2
. Response frame for register value equal to 0:
0x00 - 0x00 - 0x00 - 0x00 - 0x00 - 0x05 - 0xFF - 0x04 - 0x01 - 0x0000
Table 19.3. Response frame format for the WRITE
function (frame length - 12 bytes)
copy of the request frame for the WRITE function (Table 19.1)
Summary of Contents for AR407
Page 32: ...32 21 USER S NOTES...