Appendix B – Modbus Protocol
NMBA-01 Installation and Start-up Guide
B-17
Function Code Field: In a normal response, the slave echoes the
function code of the original query in the function code field of the
response. All function codes have a most-significant bit (MSB) of 0
(their values are all below 80 hexadecimal). In an exception response,
the slave sets the MSB of the function code to 1. This makes the func-
tion code value in an exception response exactly 80 hexadecimal
higher than the value would be for a normal response. With the function
code’s MSB set, the master’s application program can recognise the
exception response and can examine the data field for the exception
code.
Data Field: In a normal response, the slave may return data or statis-
tics in the data field (any information that was requested in the query).
In an exception response, the slave returns an exception code in the
data field. This defines the slave condition that caused the exception.
Figure B-11 ‘Master Query and Slave Exception Response’ shows an
example of a master query and slave exception response.
The field examples are shown in hexadecimal.
Figure B-11 Master Query and Slave Exception Response
QUERY
Byte
Contents
Example
1
Slave Address
0A
2
Function
01
3
Starting Address Hi
04
4
Starting Address Lo
A1
5
No. of Coils Hi
00
6
No. of Coils Lo
01
7
LRC
4F
EXCEPTION RESPONSE
1
Slave Address
0A
2
Function
81
3
Exception Code
02
4
LRC
73
efesotomasyon.com - Control Techniques,emerson,saftronics -ac drive-servo motor