EXCEPTION RESPONSE 7-1
7.0 EXCEPTION RESPONSES
Except for broadcast messages, when a master device
sends a query to a slave device it expects a normal
response. One of four possible events can occur from
the master’s query:
If the slave device receives the query without a
communication error, and can handle the query
normally, it returns a normal response.
If the slave does not receive the query due to a
communication error, no response is returned. The
master program will eventually process a timeout
condition for the query.
If the slave receives the query, but detects a
communication error (parity or CRC), no response is
returned. The master program will eventually process
a timeout condition for the query.
If the slave receives the query without a
communication error, but cannot handle it (for
example, if the request is to read a nonexistent coil or
register), the slave will return an exception response
informing the master of the nature of the error.
The exception response message has two fields that
differentiate it from a normal response.
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 function 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 recognize 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
statistics 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. Here is an example of a master query and
slave exception response. The field examples are
shown in hexadecimal.
Query
Byte Contents
Example
1 Slave
Address
01
2 Function
03
3
Starting Address Hi
04
4
Starting Address Lo
A1
5
Number of Points Hi
00
6
Number of Points Lo
01
7 CRC
Lo
D4
8 CRC
Hi
D8
Exception Response
Byte Contents
Example
1 Slave
Address
01
2 Function
83
3 Exception
Code
02
4 CRC
Lo
C0
5 CRC
Hi
F1
In this example, the master addresses a query to slave
device 01. The function code (03) is for a Read
Holding Resister operation. It requests the contents
of the holding resister at address 1245 (04A1 hex).
If the holding resister address is nonexistent in the
slave device, the slave will return the exception
response with the exception code shown (02). This
specifies an illegal data address for the slave.
7.1 Exception Codes
Code Name
01 ILLEGAL
FUNCTION
02
ILLEGAL DATA ADDRESS
03
ILLEGAL DATA VALUE
04
SLAVE DEVICE FAILURE
05 ACKNOWLEDGE
06
SLAVE DEVICE BUSY
07 NEGATIVE
ACKNOWLEDGE
08
MEMORY PARITY ERROR
The Phoenix AC drive exception response uses some
of the existing Modbus exception codes and also has
three new exception codes. The Modbus RTU Protocol
only uses exception codes 01, 02 and 03.
Exception
Code
Modbus
Name
Phoenix
Name
01
Illegal Function
Illegal Function
02 Illegal
Data
Address
Invalid Menu and/or
Parameter Number
03 Illegal
Data
Value
Illegal Data Value (Invalid
Data, Read Only, Value
Out of Range, Drive
Running, Ect.)
10 N/A
Bad
CRC
11
N/A
More data needed for valid
message
12
N/A
To much data needed for
valid message
Summary of Contents for DS Series
Page 5: ...1 2 INTRODUCTION END OF INTRODUCTION SECTION ...
Page 8: ...HARDWARE INTERFACE 2 3 Figure 2 3 Figure 2 2 Figure 2 1 ...
Page 13: ...2 8 HARDWARE INTERFACE END OF HARDWARE INTERFACE ...
Page 19: ...3 6 MODBUS RTV PROTOCAL DESCRIPTION END OF MODBUS RTU PROTOCAL DESCRIPTION ...
Page 23: ...5 2 MODBUS FUNCTION FORMATS END OF MODBUS FUNCTION FORMATS ...
Page 29: ...6 6 PHOENIX AC DRIVE FUNCTION FORMATS END OF PHOENIX AC DRIVE FUNCTION FORMATS ...
Page 31: ...7 2 EXCEPTION RESPONSE END OF EXCEPTION RESPONSE ...
Page 37: ...9 2 PARAMETER CONVERSION END OF PARAMETER CONVERSION ...
Page 43: ...A 6 APPENDIX BASIC TCP IP DESCRIPTION THIS PAGE INTENTIONALLY LEFT BLANK ...