100/180 mm PAPERLESS GRAPHIC RECORDER: USER GUIDE
HA028910
Issue 13 Sep 16
User Guide
Page 331
8.5.2 Function code 04
This is identical with function code 03, except that 04 must be used as the function code and the excep-
tion response Function code is 84 (hex) not 83.
8.5.3 Function code 06
REQUEST
This is used to write a value to a single register. The bytes after the 7-byte prefi x described in
section 8.5
,
above are:
Function code (06) (1 byte)
Register address (2 bytes)
Value to be written (2 bytes)
Thus to write a value of 80 degrees as Alarm 1 setpoint for channel 3 (register address 022F), the follow-
ing request (as detailed in fi gure 8.5.3) would be transmitted to the recorder:
0000000000060106022F0050
Figure 8.5.3 Function code 06 request/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
Byte 5
Always 00
Byte 6
Recorder
Modbus
address
Byte 7
MOodbus
function
code (hex)
00
00
00
00
00
06
01
06
Byte 8
Byte 9
Register
start
address
high byte
Byte 10
Value
high byte
(hex)
Byte 11
Register
start
address
low byte
Value
low byte
(hex)
02
2F
00
50
RESPONSE
As a response to a request, the recorder returns a message identical with the request message.
EXCEPTION RESPONSES
Byte 0 = Function code 86 (hex) (i.e. Hex (80 + function code))
Byte 1 = Exception code 01 (Illegal function) or 02 (Invalid data address)
8.5.4 Function code 08
This is used to initiate a loop-back test. The bytes after the 7-byte prefi x described in
section 8.5
, above are:
Function code (08) (1 byte)
Subfunction code (00 00) (2 bytes)
Query data (loopback value) (HH HH) (2 bytes)
Thus to initiate a loopback test (using, as an example, ‘P’ ’Q’ as the query data), the following request (as
detailed in fi gure 8.5.4) is transmitted to the recorder:
000000000006010800005051
The response to the receipt of such a message should be to ‘echo’ the request back to the host.
Figure 8.5.4 Function code 08 (loopback test) 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
08
Byte 8
Byte 9
Subfunction
code
high byte
Byte 10
Query data
high byte
(ASCII 'P')
(Hex)
Byte 11
Subfunction
code
low byte
Query data
low byte
(ASCII 'Q')
(Hex)
00
00
50
51