100/180 mm PAPERLESS GRAPHIC RECORDER: USER GUIDE
HA028910
Issue 13 Sep 16
User Guide
Page 332
8.5.5 Function code 16 (Hex 10)
REQUEST
This is used to write values to multiple registers. The bytes after the 7-byte prefi x described in
section 8.5
,
above are:
Function code (10) (1 byte)
Register Start address (2 bytes)
Word count (Total number of registers to be written) (1 to 100 decimal; 1 to 64 hex) (2 bytes)
Byte count (B) ( 2 x word count) (1 byte)
Values to be written (2B bytes).
Thus to write ”Batch Number” as batch fi eld 1 for group 1 (start address A57F), the following message
(expanded in fi gure 8.5.5a) would be transmitted to the recorder:
0000000000150110A57F00070E4261746368204E756D6265720000
Figure 8.5.5a Function code 16 request example
Byte 0
Transaction
identifier
Transaction
identifier
Protocol
identifier
Protocol
identifier
Byte 1
Byte 2
Byte 3
Byte 4
Byte 5
Always 00
Byte 6
Recorder
Modbus
address
Byte 7
00
00
00
00
00
15
01
10
Byte 8
Base
address
High byte
A5
Byte 9
Byte 10
Byte 11
Base
address
Low byte
7F
00
07
Word count
High byte
Byte 12
0E
Byte count
Word count
Low byte
Number of
bytes to fol-
low (hex)
Modbus
function
code (hex)
Byte 13
Byte 14
Byte 15
Byte 16
Byte 17
Byte 18
Byte 19
42
61
74
63
68
20
4E
Byte 20
75
ASCII
B (Hex)
ASCII
a (Hex)
ASCII
t (Hex)
ASCII
c (Hex)
ASCII
h (Hex)
ASCII
space (Hex)
ASCII
N (Hex)
ASCII
u (Hex)
Byte 21
Byte 22
Byte 23
6D
62
65
ASCII
m (Hex)
ASCII
b (Hex)
ASCII
e (Hex)
Byte 24
72
ASCII
r (Hex)
Byte 25
00
ASCII
Null
Byte 26
00
ASCII
Null
RESPONSE
The response message (detailed in fi gure 8.5.5b) after the 7-byte prefi x described in
section 8.5
, above is:
Function code 10 (1 byte)
Start address (2 bytes)
Word count (2 bytes)
Thus, the response to the above batch fi eld request would be:
0000000000060110A57F0007
Figure 8.5.5b Function code 16 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
06
01
10
Byte 8
Base
address
High byte
A5
Byte 9
Byte 10
Byte 11
Base
address
Low byte
7F
00
07
Word count
High byte
Word count
Low byte
EXCEPTION RESPONSES
Byte 0 = Function code 90 (hex) (i.e. Hex (80 + function code))
Byte 1 = Exception code 01 (Illegal function) or 02 (Invalid data address)
Note: Function code 16 can be used to write multiple registers into the indirection table area, for
example, by writing the base register address of a 32-bit channel value (e.g. channel 3 - start ad-
dress: F994) into location D18B.