• sales

    +86-0755-88291180

Protocol Manual of Modbus RTU Relay User Guide

Command format

The command contains 8 bytes:

Byte 1:Address
Byte 2:Function code
Byte3 4:Address of register (big-endian)
Byte 5 6:data of register (big-endian)
Byte7 8:CRC cheksum (little-endian)

Function code

Function codeDescription
01Read state of Relay
03Read address, revision读
05Write single Relay
06Configure baudrate, address
0FWrite all Relays

Control single relay

command:01 05 00 00 FF 00 8C 3A

ByteMeaningDescription
01Device address0x00 is broadcast address;0x01-0xFF are device addresses
0505 CommandCommand for controlling Relay
00 00AddressThe register address of controlled Relay, 0x00 - 0x0008
FF 00Command0xFF00:Open Replay;
0x0000:Close Relay;
0x5500:Flip Relay
8C 3ACRC16The CRC checksum of first six bytes.

Answer: 01 05 00 00 FF 00 8C 3A

ByteMeaningDescription
01Device address0x00 is broadcast address;0x01-0xFF are dives addresses
0505 CommandCommand for controlling relay
00 00AddressThe register address of controlled Relay,0x0000-0x0008
FF 00Command0xFF00:Open Relay;
0x0000:Close Relay
0x5500:Flip Relay.
8C 3ACRC16The CRC cheksum of first six bytes.

Examples: [Device with address 01]: Open Relay 0: 01 05 00 00 FF 00 8C 3A
Close Relay 0: 01 05 00 00 00 00 CD CA
Open Relay 1: 01 05 00 01 FF 00 DD FA
Close Relay 1: 01 05 00 01 00 00 9C 0A
Open Relay 2: 01 05 00 02 FF 00 2D FA
Close Relay 2: 01 05 00 02 00 00 6C 0A
Open Relay 3: 01 05 00 03 FF 00 7C 3A
Close Relay 3: 01 05 00 03 00 00 3D CA
Flip Relay 0: 01 05 00 00 55 00 F2 9A
Flip Relay 1: 01 05 00 01 55 00 A3 5A
Flip Relay 2: 01 05 00 02 55 00 53 5A
Flip Relay 3: 01 05 00 03 55 00 02 9A

Controll all Relay

Command:01 05 00 FF FF FF FC 4A

ByteMeaningDescription
01Device address0x00 is broadcast;0x01-0xFF are devices address
0505 commandCommand for controlling Relay
00 FFAddressFixed 0x00FF
FF FFCommand0xFFFF:Open Relay;
FC 4ACRC16The CRC cheksum of first six bytes

Answer: 01 05 00 FF FF FF FC 4A

ByteMeaningDescription
01Devices0x00 is broadcast address;0x01-0xFF is device address
0505 CommandCommand for controlling
00 FFAddressFixed 0x00FF
FF FFCommand0xFFFF:Open Relay;
0x0000:Close Relay;
0x5A00:Flip Relay;
FC 4ACRC16The CRC16 checksum of first six bytes.

Example:

[Device with address 01]:

Open all Relays : 01 05 00 FF FF FF FC 4A
Close all Relays : 01 05 00 FF 00 00 FD FA
Flip all Relays : 01 05 00 FF 5A 00 C7 5A

Read states of all Relays

Command:01 01 00 FF 00 01 CD FA

BytesMeaningDescription
01Device address0x00 is broadcast address;0x01-0xFF are device addresses
0101 CommandCommand for checking states of Relay
00 FFAddressFixed 0x00FF
00 01CommandFixed 0x0001
CD FACRC16The CRC16 of the first six bytes

Answer:01 01 01 00 51 88

ByteMeaningDescription
01Device address0x00 is broadcast address;0x01-0xFF are device addressese
0101 CommandCommand for checking states of Relay
01NumberThe number of bytes returned。
00SateThe state of Relay
Bit0:The state of the first Relay;
Bit1: The state of the second Relay;
Bit2: The state of the third Relay;
……
Bit7:The state of the eighth Relay;
8C 35CRC16The CRC cheksum of first six bytes.

Examples:

[Device with Address 01]

Command : 01 01 00 FF 00 01 CD FA
Answer: 01 01 01 00 51 88 //Close all Relays
Command : 01 01 00 FF 00 01 CD FA
Answer : 01 01 01 01 90 48 //Open Relay 0号 and close other Relays
Command : 01 01 00 FF 00 01 CD FA
Answer : 01 01 01 41 91 B8 //Open Relay 0 and Relay 6号, close other Relays

Write Relay

Command:01 0F 00 00 00 01 94 0B

ByteMeaningDescription
01Device address0x00 is the boradcast address;0x01-0xFF are device addresses
0F0F CommandCommand for writing Relay
00 00AddressFxied 0x0000
00 01CommandBit0:Control the first Relay;
Bit1:Control the second Relay;
Bit2:Control the third Relay;
……
Bit7:Control the eighth Relay;
94 0BCRC16The CRC checksum of first six bytes.

Answer:01 0F 00 00 00 01 94 0B

ByteMeaningDescription
01Device address0x00 is the boradcast address;0x01-0xFF are device addresses
0F0F CommandCommand for controlling all Relay
00 00AddressFixed 0x0000。
00 01Command0x0001,Write Relay sate
Bit0:Control the first Relay;
Bit1:Control the second Relay;
Bit2:Control the third Relay;
……
Bit7: Control the eighth Relay;
94 0BCRC16The CRC checksum of first six bytes.

Example:

[Device with address 01]

Open all Relay : 01 0F 00 00 00 FF 15 8B
Close all Relay : 01 0F 00 00 00 00 55 CB
0-1 Open;3-7 Close  : 01 0F 00 00 00 03 15 CA

Open/Close Relay in current time

Command:01 05 02 00 00 07 8D B0

ByteMeaningDescription
01Device address0x00 is the boradcast address;0x01-0xFF are device addresses
0505 CommandCommand for controlling signle Relay
02Command02 is command for close Relay in current time,04 is command for open Relay in current time
00Address of RelayThe address of Relay controlled
00 07DelayThe Delay time is Data*100ms
Data:0x0007,Delay:7*100MS = 700MS
8D B0CRC16The CRC checksum of first six bytes.

Answer:01 05 02 00 00 07 8D B0

ByteMeaningDescription
01Device address0x00 is the boradcast address;0x01-0xFF are device addresses
0505 CommandCommand for controlling single Relay
02Command02 is command for close Relay in current time,04 is command for open Relay in current time
00Address of RelayThe address of Relay controlled
00 07DelayThe delay time is the data*100ms
data:0x0007,Delay:7*100MS = 700MS
8D B0CRC16The CRC checksum of first six bytes.

Example:

[Device with address 01]

Open Relay 0 : 01 05 02 00 00 07 8D B0 //700MS = 7*100MS = 700MS
Open Relay 1 : 01 05 02 01 00 08 9C 74 //800MS
Close Relay 0 : 01 05 04 00 00 05 0C F9 //500MS
Close Relay 1 : 01 05 04 01 00 06 1D 38 //600MS

Set baud rate

Command:00 06 20 00 00 05 43 D8

ByteMeaningDescription
00设备地址0x00 is the boradcast address;0x01-0xFF are device addresses
0606 CommandSet baud rate or device address
20 00Command register0x2000: Set baud rate,0x4000:Set device address
00 05Baud rateBaudrate:
0x0000  : 4800
0x0001  : 9600
0x0002  : 19200
0x0003  : 38400
0x0004  : 57600
0x0005  : 115200
0x0006  : 128000
0x0007  : 256000
43 D8CRC16The CRC checksum of first six bytes.

Answer:00 06 20 00 00 05 43 D8

ByteMeaningDescription
00Device address0x00 is the boradcast address;0x01-0xFF are device addresses
0606 CommandSet baud rate or device address
20 00Command register0x2000: Set baud rate,0x4000 Set device address
00 05Baud rateThe baud rate
0x0000  : 4800
0x0001  : 9600
0x0002  : 19200
0x0003  : 38400
0x0004  : 57600
0x0005  : 115200
0x0006  : 128000
0x0007  : 256000
43 D8CRC16The CRC checksum of first six bytes.

Example:

[Device with address 0x01]

Set baud rate as 4800 :00 06 20 00 00 00 83 DB
Set baud rate as 9600 :00 06 20 00 00 01 42 1B
Set baud rate as 115200 :00 06 20 00 00 05 43 D8

Set device address

Command:00 06 40 00 00 01 5C 1B

ByteMeaningDescription
00Device address0x00 is the boradcast address;0x01-0xFF are device addresses
0606 CommandSet baud rate or device address
40 00Command register0x2000: Set baud rate,0x4000: Set device address
00 01Device addressThe device address,0x0001-0x00FF
5C 1BCRC16The CRC checksum of first six bytes.

Answer:00 06 40 00 00 01 5C 1B

ByteMeaningDescription
00Device address0x00 is the boradcast address;0x01-0xFF are device addresses
0606 CommandSet baud rate or device address
40 00Command register0x2000: Set baud rate,0x4000:Set device address
00 01Device addressSet device address,0x0001-0x00FF
5C 1BCRC16The CRC checksum of first six bytes.

Example:

[Device with address 0x01]

Set device address as 0x01 :00 06 40 00 00 01 5C 1b
Set device addrss as 0x02 :00 06 40 00 00 02 1C 1A
Set device address as 0x03 :00 06 40 00 00 03 DD DA

Read device address

Command:00 03 40 00 00 01 90 1B

ByteMeaningDescription
00Device address0x00 is the boradcast address;0x01-0xFF are device addresses
0303 CommandRead Device address
40 00Command register0x0200: Read software revision,0x0040: Read device address
00 01Device addressDevice address
90 1BCRC16The CRC checksum of first six bytes.

Answer:01 03 01 01 31 88

ByteMeaningDescription
00Device address0x00 is the boradcast address;0x01-0xFF are device addresses
0303 commandRead software revision or device address
01Number of bytesNumber of bytes returned
01Device addressDevicess
31 88CRC16The CRC checksum of first six bytes.

Example:

[Device with address 01]

Command : 00 03 40 00 00 01 90 1B
Answer : 01 03 01 01 31 88 //地址0x01
[Device with address 02]

Command : 00 03 40 00 00 01 90 1B
Answer : 02 03 01 02 71 CD //地址0x02
[Device with address 03]

Command : 00 03 40 00 00 01 90 1B
Answer : 03 03 01 03 B1 F1 //地址0x03

Read software revision

Command:01 03 20 00 00 01 8F CA

ByteMeaningDescription
01device address0x00 is the boradcast address;0x01-0xFF are device addresses
0303 CommandRead software revision or device address
20 00Command register0x0200: Read software revision,0x0040: Read device address.
00 01Device addressDevice address
8F CACRC16The CRC checksum of first six bytes.

Answer:01 03 01 64 F1 A3

ByteMeaningDescription
01Device address0x00 is the boradcast address;0x01-0xFF are device addresses
0303 CommandRead software revision, read device address
01Number of bytesnumber of bytes returned
64Revision of SoftwareConvert it to DEX and multiply by 0.01 is the value of software revision.


0x64 = 100 = V1.00

F1 A3CRC16The CRC checksum of first six bytes.

Example:

Command:01 03 20 00 00 01 8F CA
Answer:01 03 01 64 F1 A3 // 64 = 100 =V1.00