Appendix B – Modbus Protocol
NMBA-01 Installation and Start-up Guide
B-5
How the Address Field
is Handled
The address field of a message frame contains eight bits (RTU). Valid
slave device addresses are in the range of 0 – 247 decimal. The indi-
vidual slave devices are assigned addresses in the range of 1 – 247. A
master addresses a slave by placing the slave address in the address
field of the message. When the slave sends its response, it places its
own address in this address field of the response to let the master
know which slave is responding.
Address 0 is used for the broadcast address, which all slave devices
recognise. When Modbus protocol is used on higher level networks,
broadcasts may not be allowed, or may be replaced by other methods.
For example, Modbus Plus uses a shared global database that can be
updated with each token rotation.
How the Function Field
is Handled
The function code field of a message frame contains eight bits (RTU).
Valid codes are in the range of 1 – 255 decimal. Of these, some codes
are applicable to all Modicon controllers, while some codes apply only
to certain models, and others are reserved for future use. The NMBA-
01 supports the function codes 3, 6, and 16 (0x03, 0x06, and 0x10
Hex) only.
When a message is sent from a master to a slave device the function
code field tells the slave what kind of action to perform. Example is to
read a group of outputs.
When the slave responds to the master, it uses the function code field
to indicate either a normal (error-free) response or that some kind of
error occurred (called an exception response). For a normal response,
the slave simply echoes the original function code. For an exception
response, the slave returns a code that is equivalent to the original
function code with its most significant bit set to a logic 1.
For example, a message from master to slave to read a group of hold-
ing registers would have the following function code:
0000 0011
(Hexadecimal 03)
If the slave device takes the requested action without error, it returns
the same code in its response. If an exception occurs, it returns:
1000 0011
(Hexadecimal 83)
In addition to its modification of the function code for an exception
response, the slave places a unique code into the data field of the
response message. This tells the master what kind of error occurred, or
the reason for the exception.
The master device’s application program has the responsibility of han-
dling exception responses. Typical processes are to post subsequent
retries of the message, to try diagnostic messages to the slave, and to
notify operators.
efesotomasyon.com - Control Techniques,emerson,saftronics -ac drive-servo motor