Address field, Function field, Figure a.2—example message frame 186 – Watlow CPC400 User Manual
Page 200
![background image](/manuals/359052/200/background.png)
Appendix A: Modbus Protocol
CPC400 Series User’s Guide
186
Watlow Anafaze
Doc. 0600-2900-2000
Figure A.2
Example Message Frame
Address Field
The address field of a message frame contains eight bits.
Valid slave device addresses are in the range of 0 to 247
decimal. The individual slave devices are assigned address-
es in the range of 1 to 247. Address 0 is reserved for broad-
cast messages. The CPC400 controller currently supports
only 32 devices. 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.
Function Field
The function code field of a message frame contains eight
bits. Valid codes are in the range of 1 to 255 decimal. Not
all of these codes are applicable to CPC400 controllers.
Current codes are described in Function Codes on page 190.
When a message is sent from a master to a slave device, the
function code field tells the slave what kind of action to per-
form. For example, the function code might tell the slave to
read the on/off states of a block of digital inputs or outputs,
to read the data contents of a block of registers, or to read
the diagnostic status of a controller.
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 func-
tion code with its most significant bit set to a logic 1.
For example, a message from the master to slave to read a
block of holding registers would have thisg 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 oc-
curs, it returns:
1000 0011 Hexadecimal 83
Start
Address
Function
Data
CRC Check
End
T1-T2-T3-T4
8 Bits
8 Bits
n X 8 Bits
16 Bits
T1-T2-T3-T4