321
CHAPTER 8 - CFW-09 OPTIONS AND ACCESSORIES
8.14.3.1
Function 01 -
Read Coils
It reads the content of an internal group of bits that must compulsorily in
a numerical sequence. This function has the following structure for the
read and response messages (the values are always hexadecimal, and
each filed represents one byte):
Query (Master)
Slave address
Function
Initial bit address (byte high)
Initial bit address (byte low)
Number of bits (byte high)
Number of bits (byte low)
CRC-
CRC+
-
Response (Slave)
Slave address
Function
Byte Count Field (number of data bytes)
Byte 1
Byte 2
Byte 3
etc to
CRC-
CRC+
Each response bit is placed at a position of the data bytes sent by the
slave. The first byte, from the bits 0 to 7, receives the first 8 bits from the
initial address indicated by the master. The other bytes (if the number of
the read bits is higher than 8) remain in the same sequence. If the number
of the read bits is not a multiple of 8, the remaining bits of the last byte
should be filled out with 0 (zero).
Example: reading of the status bits for general enable (bit 1) and
direction of rotation (bit 2) of then CFW-09 at the address 1:
Query (Master)
Field
Value
Slave address
01h
Function
01h
Initial bit address (byte high)
00h
Initial bit address (byte low)
01h
Number of bits (byte high)
00h
Number of bits (byte low)
02h
CRC-
ECh
CRC+
0Bh
Response (Slave)
Field
Value
Slave address
01h
Function
01h
Byte Count
01h
Status of the bits 1 and 2
02h
CRC-
D0h
CRC+
49h
-
-
-
-
8.14.3.2
Function 03 - Read
Holding Register
It reads the content of a group of registers that must be compulsorily in a
numerical sequence. This function has following structure for the read
and response messages (the values are always hexadecimal values, and
each field represents one byte):
As the number of read bits in the example is smaller than 8, the slave
required only 1 byte for the response. The value of the byte was 02h, that
as binary value will have the form 0000 0010. As the number of read bits is
equal to 2, only the two less significant bits, that have the value 0 = general
disable and 1 = direction of rotation, are of interest. The other bits, as
they did not be requested, are filled out with 0 (zero).