Modbus RTU RS-485
29
SFIDK.PS.023.D2.02
APPENDIX C
05 (0x05) Force single coil
Query
Slave address 1 byte
Function 1 byte
Coil Address Hi 1 byte
Coil Address Lo 1 byte
Force Data Hi 1 byte
Force Data Lo 1 byte
CRC 2 bytes
Slave address 1 byte
Function 1 byte
Coil Address Hi 1 byte
Coil Address Lo 1 byte
Force Data Hi 1 byte
Force Data Lo 1 byte
CRC 2 bytes
Response
Examples
Coil 0 (Restart Modbus communication)
To activate a new baudrate and parity/framing the coil 0 (restart Modbus communication)
must be send. Otherwise a power down/up initiate a new baudrate and parity/framing:
Query: 1,5,0,0,255,0,140,58 (Set coil 0 to 0xFF00)
Receive: 1,5,0,0,255,0,140,58 (Restart Modbus communication)
16 (0x10) Write multiple registers
Query
Slave address 1 byte
Function 1 byte
Starting Address Hi 1 byte
Starting Address Lo 1 byte
No. of Registers Hi 1 byte
No. of Registers Lo 1 byte
Byte Count 1 byte
Data Hi 1 byte
Data Lo 1 byte
:
Data Hi 1 byte
Data Lo 1 byte
CRC 2 bytes
Slave address 1 byte
Function 1 byte
Starting Address Hi 1 byte
Starting Address Lo 1 byte
No. of Registers Hi 1 byte
No. of Registers Lo 1 byte
CRC 2 bytes
Response
Examples
Set baud rate to 115200 baud
Query: 1,16,2,17,0,1,2,0,8,135,23 (115200 = value 8)
Receive: 1,16,2,17,0,1,80,116
To activate a new baudrate and parity/framing the coil 0 (Restart Modbus communication)
must be send.
Otherwise a power down/up initiate a new baudrate and parity/framing:
Query: 1,5,0,0,255,0,140,58 (Set coil 0 to 0xFF00)
Receive: 1,5,0,0,255,0,140,58 (Restart Modbus communication)