Information Technology Reference
In-Depth Information
18.1.4 Address field
The address field contains either two ASCII characters (for ASCII mode) or eight bits (for
RTU mode). Addresses range from 0 to 247 (00h to F7h), where 0 is the broadcast address
and 1 to 247 are used for slaves addresses. A master communicating with the slave puts the
slave's address in the address field, and the slave, when responding, puts its own address in
the address field (to identify itself).
18.1.5 Function field
The function field contains either two ASCII characters (for ASCII mode) or eight bits (for
RTU mode). Codes range from 1 to 255 (00h to FFh), and they are used by the master to
inform the slave as to the action which requires to be performed. Typical codes (in decimal)
are:
01
Read coil status
02 Read input status
03 Read holding registers
04
Read input registers
05 Force single coil
06 Preset single register
07
Read exception status
08 Diagnostics
11 Fetch comm. event counter
12
Fetch comm. event log 13 Program controller
14 Poll controller
15
Force multiple coils
16 Preset multiple registers
17
Report Slave ID
18 Program 884/M84
19 Reset communication link
20
Read general reference 21 Write general reference
22
Mask write 4x reference 23 Read/write 3x registers 24 Read FIFO queue
For example, the read coil status gives an ON/OFF status for discrete outputs. When there
are no errors the slave sends back the original function code, else, on an error, the same code
is sent back, expect the most-significant bit is set to a 1. For example, if the function code
was 0000 1000, then, on an error, the return value will be 1000 1000. A status code is also
added in the data field, these are outlined in Table 18.1.
Table 18.1
Exception codes
Code
Name
Description
01
Illegal function
The message function received is not an allowable action for the
addressed salve.
02
Illegal data address
The address referenced in the data field is not an allowable address
for the addressed slave location.
03
Illegal data value
The value referenced in the data field is not allowable in the ad-
dressed slave location.
04
Failure in associated
device
The slave's subcontroller has failed to respond to a message or an
abortive error occurred.
05
Acknowledge
The slave has accepted and is processing the long duration program
command.
06
Busy, rejected mes-
sage
The message was received without error, but the slave is currently
busy.
For example, if the master sends the message
 
Search WWH ::




Custom Search