322
CHAPTER 8 - CFW-09 OPTIONS AND ACCESSORIES
8.14.3.3
Function 05 - Write
Single Coil
This function is used to write a value to a single bit. The bit value is
represented by using two bytes, where FF00h represents the bit that is
equal to 1, and 0000h represents the bit that is equal to 0 (zero). It has
the following structure (the values are always hexadecimal, and each
field represents one byte):
Example: Read of the value proportional to the frequency value (P002)
and motor current (P003) of the CFW-09 at address 1:
Query (Master)
Slave address
Function
Initial register address (byte high)
Initial register address (byte low)
Number of registers (byte high)
Number of registers (byte low)
CRC-
CRC+
-
-
Response (Slave)
Slave address
Function
Byte Count Field
Data 1 (high)
Data 1 (low)
Data 2 (high)
Data 2 (low)
etc to
CRC-
CRC+
Query (Master)
Field
Value
Slave address
01h
Function
03h
Initial register (byte high)
00h
Initial register (byte low)
02h
Number of registers (byte high)
00h
Number of registers (byte low)
02h
CRC-
65h
CRC+
CBh
-
-
Response (Slave)
Field
Value
Slave address
01h
Function
03h
Byte Count
04h
P002 (high)
03h
P002 (low)
84h
P003 (high)
00h
P003 (low)
35h
CRC-
7Ah
CRC+
49h
Each register is always formed by two bytes (high e low). For the example,
we have P002 = 0384h, that in decimal number is equal to 900.
As these parameters do not have a decimal place indication, the real
read value is 900 rpm. In the same way we will have a current value
P003 = 0035h, that is equal to a 53 decimal. As the current has a decimal
resolution, the read value is 5.3 A.
Query (Master)
Slave address
Function
Bit address (byte high)
Bit address (byte low)
Bit value (byte high)
Bit value (byte low)
CRC-
CRC+
Response (Slave)
Slave address
Function
Bit address (byte high)
Bit address (byte low)
Bit value (byte high)
Bit value (byte low)
CRC-
CRC+