SAMWONTECH
1st Edition of TEMI2000_Series IM : Dec. 15. 2008 Page 23 / 58
6.6 Function code - 16
Function code-16 is used to write the data into consecutive D-Register block in sequence up to 64 registers.
▣ Request Message Frame
Factor
ASCII
RTU
Protocol Header
:(Colon)
-
Slave address
2 characters
8-Bit
Function code-16
2 characters
8-Bit
D-Register Hi
2 characters
8-Bit
D-Register Lo
2 characters
8-Bit
Address Count Hi
2 characters
8-Bit
Address Count Lo
2 characters
8-Bit
Data byte Count
2 characters
8-Bit
Data - 1 Hi
2 characters
8-Bit
Data - 1 Lo
2 characters
8-Bit
…
…
…
Data - n Hi
2 characters
8-Bit
Data - n Lo
2 characters
8-Bit
Error detecting
2 characters
16-Bit
Protocol Tail
2 characters (CR+LF)
-
◈
Example
Request message to write ‘10.0’ to the D0102(TEMP.SP) and ‘20.0’ to the D0103(HUMI.SP) on FIX mode
operation should be
- MODBUS ASCII
:01100065000204006400C858[cr][lf]
- MODBUS RTU
01100065000204006400C875F1
▣ Response Message Frame
Factor
ASCII
RTU
Protocol Header
:(Colon)
-
Slave address
2 characters
8-Bit
Function code-16
2 characters
8-Bit
D-Register Hi
2 characters
8-Bit
D-Register Lo
2 characters
8-Bit
Address Count Hi
2 characters
8-Bit
Address Count Lo
2 characters
8-Bit
Error detecting
2 characters
16-Bit
Protocol Tail
2 characters (CR+LF)
-
◈
Example
Without any trouble, response message will be
- MODBUS ASCII
:01100065000288[cr][lf]
- MODBUS RTU
01100065000251D7