More information
The
write
request
contains:
● Address of the Modbus slave
● Function code (FC)
● Start Address
● Depending on FC:
additional control information to define the amount of data to be written (NO. of
elements, ByteCount).
● Data to be written
A
positive response
contains:
● Response FC = Request FC
● Response start address = Request start address
● Depending on FC:
– written data:
response data is read back from the BA-object to indicate e.g. min/max
truncation (no simple echo of the request).
– or:
information to indicate the number of written data elements
An
exception
response, if the server is unable to process the write request.
The objective is to provide to the client relevant information concerning the error
detected during processing:
● The exception FC = request FC + 0x80.
● An exception code is provided to indicate the reason of the error.
Code Name Meaning
01 ILLEGAL FUNCTION Function code received in the request is not supported by the server.
Or: Server is currently unable to process the request, e.g. because it is un-configured.
02 ILLEGAL DATA
ADDRESS
The register address/starting address received in the request is not an allowable address for the
server.
Or: The combination of starting address and quantity of registers is invalid, e.g. for a controller with 100
registers, the PDU addresses the first register as 0, and the last one as 99.
If a request is submitted with a starting address of 96 and the quantity of registers is 4, the request
succeeds (address-wise at least) on registers 96, 97, 98, 99.
If a request is submitted with a starting address of 96 and the quantity of registers is 5, the request fails
with exception code 0x02 "Illegal Data Address" since it attempts to operate on registers 96, 97, 98, 99
and 100, and there is no register with address 100.
In the event of bulk read/write if there is address gap between data items in the given address range.
03 ILLEGAL DATA VALUE A data type contained in the write data is not an allowable value for the server.
This indicates a fault in the structure of the remainder of a complex request, such as that the implied
data length is incorrect (data type mismatch).
However, it specifically does NOT mean that a data item submitted for storage in a register has a value
outside the allowed min / max range, since the Modbus protocol is unaware of the significance of any
particular value of any particular register.
04 SERVER DEVICE
FAILURE
An unrecoverable error occurred while the server was attempting to perform the requested action, e.g.
● Master tries to write read-only data item
● Access to unsupported BA-Object type, mapping is not possible
● Master tries to write data fragments, illegal data, etc.
Engineering of communicative devices
Modbus slave
6
158 | 170 A6V10733786_en_c