The following page shows an example of a request to force a series of
ten coils starting at coil
20 (addressed as 19, or 13 hex) in slave device 17.
The query data contents are two bytes: CD 01 hex (1100 1101 0000 0001 binary). The binary
bits correspond to the coils in the following way:
Bit: 1 1 0 0 1 1 0 1 0 0 0 0 0 0 0 1
Coil: 27 26 25 24 23 22 21 20 - - - - - - 29 28
The first byte transmitted (CD hex) addresses coils 27 ... 20, with
the least significant bit
addressing the lowest coil (20) in this set.
The next byte transmitted (01 hex) addresses coils 29 and 28, with the least significant bit
addressing the lowest coil (28) in this set. Unused bits in the last data byte should be zero-filled.
Response
The normal response
returns the slave address, function code,
starting address, and quantity of
coils forced. Here is an example of a response to the query shown above:
Chia sẻ với bạn bè của bạn: