
33
4.8.6 Complete Command Frame Analysis
1.
Read Coil Status (0x01)
Read Coil Status Example Query
Field Name
Byte length
Example Value
Slave Address
1
1~200
Function Code
1
0x01
Starting Address
2
0~0xFFFF
O. of Points
2
1~16
CRC Error Check
2
Read Coil Status Example for aLogical Response
Filed Name
Byte length
Example Value
Slave Address
1
1~200
Function Code
1
0x01
Byte Count
1
1~2
Data(Coil Status)
n
CRC Error Check
2
Read Coil Status Example in anIllogical Response
Field Name
Byte length
Example Value
Slave Address
1
1~200
Function Code
1
0x81
Abnormal Code
1
01~04
CRC Error Check
2
Example
:
The following example reads the load input state (ISTATE) of the Coil of the slave device as address
0x01.
From table 4.8.7.1 below, we know that the ISTATE address is 0x0510.
Query:
0x01 0x01 0x05 0x10 0x00 0x01 0xFC 0xC3
The Corresponding Nomal Response:
0x01 0x01 0x01 0x48 0x51 0xBE, within which, 0x48 is the
read-back data and its lowest bit is 0 that means the input state ISTATE is OFF
.
2.
Force Single Coil (0x05)
Force Single Coil Example Query
Field Name
Byte length
Example Value
Slave Address
1
1~200
Function Code
1
0x05
Coil Address
2
0~0xFFFF
Force Data (Coil Status)
2
0x0000 or xFF00
CRC Error Check
2
Force Single Coil Example for a Logical Response
Field Name
Byte length
Example Value
Slave Address
1
1~200
Function Code
1
0x01
株式会社ロイノス