7-6
[Response]
The coils in the response message are packed as
one coil per bit of the data field.
When reading 15 coils with the coil number of
0001h through 000Fh (in the above request), it
returns the codes the following.
Hi: high order
Lo: low order
The status of outputs 8 through 1 is shown as the
byte value "40h", or binary "0100 0000b". Output
8 is the MSB of this byte, and output 1 is the LSB.
Likewise, the status of outputs F through 9 is
shown as the byte value "12h", or binary "0001
0010b". Output F is in the seventh bit position
from the right, and output F is the MSB of this byte.
The one remaining high order bit is zero filled.
↑
If the returned output quantity is not a multiple of
eight, the remaining bits in the final data byte will
be padded with zeros (toward the high order end
of the byte).
By convention, bits within a byte are shown with
the MSB to the left, and the LSB to the right.
In the case, 5 byte lengths
(address 6 through 10).
Coil number:
“0008h”through“0001h”
Coil number:
“000Fh”through“0009h”