100/180 mm PAPERLESS GRAPHIC RECORDER: USER GUIDE
HA028910
Issue 13 Sep 16
User Guide
Page 330
8.5.1 Function code 03
REQUEST
The bytes after the 7-byte prefi x described above are:
Function code (03) (1 byte)
Register start address (2 bytes)
Word count (Total number of registers) (1 to 125 decimal; 1 to 7D hex) (2 bytes)
Thus to read Channel 5 descriptor (start address 031F - 10 registers altogether) the following request (as
described in fi gure 8.5.1a) would be transmitted for a recorder with a Modbus address of 1:
0000000000060103031F000A
Figure 8.5.1a Function code 03 request example
Byte 0
Transaction
identifier
Transaction
identifier
Protocol
identifier
Protocol
identifier
Byte 1
Byte 2
Byte 3
Byte 4
Number of
bytes fol-
lowing
Byte 5
Always 00
Byte 6
Recorder
Modbus
address
Byte 7
Modbus
function
code (hex)
00
00
00
00
00
06
01
03
Byte 8
Byte 9
Register
start
address
high byte
Byte 10
Word count
high byte
Byte 11
Register
start
address
low byte
Word count
low byte
03
1F
00
0A
RESPONSE
As a response to a request, the recorder returns a similar message, but the function code (03) is followed by:
Byte count (= 2 x the number of register values requested) in hex (1 byte)
Value of register at start address (2 bytes)
Value of register at start a 1 (2 bytes)
etc.
etc.
Value of fi nal register (2 bytes)
Thus as a response to the above request for channel 5 descriptor, the following message (as expanded
in fi gure 8.5.1b) would be returned to the host (assuming channel descriptor to be: Channel 5 Descriptor
and Modbus address = 1):
0000000000170103144368616E6E656C20352044657363726970746F72
Figure 8.5.1b Function code 03 response example
Byte 0
Transaction
identifier
Transaction
identifier
Protocol
identifier
Protocol
identifier
Byte 1
Byte 2
Byte 3
Byte 4
Number of
bytes fol-
lowing (hex)
Byte 5
Always 00
Byte 6
Recorder
Modbus
address
Byte 7
Modbus
function
code (hex)
00
00
00
00
00
17
01
03
Byte 8
Byte count
(No of reg-
isters x 2)
(Hex)
14
Byte 9
Byte 10
Byte 11
ASCII
C (Hex)
43
68
61
ASCII
h (Hex)
ASCII
a (Hex)
Byte 12
Byte 13
Byte 14
Byte 15
Byte 16
Byte 17
Byte 18
Byte 19
6E
6E
65
6C
20
35
20
44
Byte 20
65
ASCII
n (Hex)
ASCII
n (Hex)
ASCII
e (Hex)
ASCII
l (Hex)
ASCII
space (Hex)
ASCII
5 (Hex)
ASCII
space (Hex)
ASCII
D (Hex)
ASCII
e (Hex)
Byte 24
Byte 25
Byte 26
Byte 27
Byte 28
Byte 21
Byte 22
Byte 23
73
63
72
ASCII
s (Hex)
ASCII
c (Hex)
ASCII
r (Hex)
69
70
74
6F
72
ASCII
i (Hex)
ASCII
p (Hex)
ASCII
t (Hex)
ASCII
o (Hex)
ASCII
r (Hex)
EXCEPTION RESPONSES
Byte 0 = Function code 83 (hex) (i.e. Hex (80 + function code))
Byte 1 = Exception code 01 (Illegal function) or 02 (Invalid data address)