12: M
ODBUS
ASCII/RTU C
OMMUNICATION
12-18
FC5A M
ICRO
S
MART
U
SER
’
S
M
ANUAL
FC9Y-B1268
Function Code 03 (Read Holding Registers) and Function Code 04 (Read Input Registers)
Function code 03 reads word device data of D (data register), T (timer preset value), or C (counter preset value). One
through 64 consecutive words can be read out.
Function code 04 reads word device data of T (timer current value) or C (counter current value). One through 64 consec-
utive words can be read out.
Communication Frame
Request from Modbus Master
Slave No.
Function Code
Address
No. of Words
xxh
03h / 04h
xxxxh
xxxxh
ACK Reply from Modbus Slave
Slave No.
Function Code
Quantity of
Data
First High Byte
First Low Byte
Last Low Byte
xxh
03h / 04h
xxh
xxh
xxh
xxh
NAK Reply from Modbus Slave
Slave No.
Function Code
Error Code
xxh
83h / 84h
xxh
Communication Example
Purpose
Read 2 words starting at data register D1710.
D1710
(1710 – 0) + 400001 = 401711
Modbus address: 401711
Extract lower 5 digits
1711
1711 – 1 = 1710 = 6AEh
Communication frame address: 06AEh
Condition
Slave No. 8
D1710 data: 1234h
D1711 data: 5678h
ASCII Mode
Request from Modbus Master
‘:’ 3038 3033 30364145 30303032 (LRC) CRLF
ACK Reply from Modbus Slave
‘:’ 3038 3033 3034 3132 3334 3536 3738 (LRC) CRLF
NAK Reply from Modbus Slave
‘:’ 3038 3833 xxxx (LRC) CRLF
RTU Mode
Request from Modbus Master
08 03 06AE 0002 (CRC)
ACK Reply from Modbus Slave
08 03 04 12 34 56 78 (CRC)
NAK Reply from Modbus Slave
08 83 xx (CRC)
Phone: 800.894.0412 - Fax: 888.723.4773 - Web: www.clrwtr.com - Email: [email protected]