Description :
The value of Register and coil address is stored as byte value. According to the value of the
address first use address Low order bit, and then use address high order bit. For each address
bit , The first byte contains the high order bits and the second byte contains the low order bits.
The framing of query and response message contains seventeen bytes which is fixed .
Framing starting [55][55] :the value is fixed.
Addressing offset [00]: If coils M0 is addressed as 0 the address offset is [00], If coils M1 is
addressed as 0 the address offset is [01],
Response status: 0x00 expresses error ,0xFF expresses right
Address low order bit: [00][19] expresses that the address of the coil to be read is 25 (D).
The response state [FF] expresses normal response, [00] expresses abnormal response.
Verify value: plus all bytes from framing starting byte to the penultimate byte, take the last byte of
the summation as verify value.
2. Write Single Coil M (0x41)
Use this function code to setup ON/OFF state of single coil in controller
The ON/OFF state of requested coil is specified by a constant in the query data field. A value of
FF 00 hex requests the coil to be ON. A value of 00 00 requests it to be OFF. Any other values
are illegal and will not affect the coil.
Here is an example of writing coil M25
use function key to set the coil status and use indicator to indicate it.