Two way IO module serial port relay control board
Download link for materials:
http://pan.baidu.com/share/link?shareid=784471305&uk=1493463775
Working power supply 12V, 24V optional,Communication options: RS232/RS485/RS232+RS485/Ethernetagreement
Support: Modbus RTU or protocol customization, default: modbus RTU
Supporting software: Configuration software such as Wangli Control supports human-machine interfaces such as Kunlun
Provide technical support: provide debugging tools, VB source code engineering, C # source code engineering, Kingview instance engineering
Serial portIOModule(XYS-0102)Communication Protocol
Swing controllerModbusRTUversion
1Communication instructions
1) Communication parameter settings: 9600,N,8,1
|
parameter |
describe |
notes |
|
9600 |
Baud rate |
|
|
N |
check bit |
|
|
8 |
Data bits |
|
|
1 |
stop bit |
|
2) Communication baud rate setting command:
send out:01 06 01 00 00 02 09 F7(Example)/16Base system)
|
data |
byte |
Data Description |
notes |
|
01 |
1 |
Module address |
addresses01-FE |
|
06 |
1 |
function code |
06-Write single register |
|
0100 |
2 |
Register address(4xtype) |
0100-Modify communication baud rate |
|
0002 |
2 |
Write data |
0001-set baud rate4800 0002-set baud rate9600 0003-set baud rate19200 |
|
09 F7 |
2 |
CRCCheck Code |
All the previous dataCRCCheck Code |
receive:01 06 01 00 00 02 09 F7(Example)/16Base system)
This command instructs a module to set its baud rate to9600This setting can be powered off
preservation; The default baud rate for the module is9600After setting the new baud rate, the correct selection should be made in the communication settings
Baud rate,And restart the communication port. When the module receives the correct command, it will take corresponding actions according to the command,
And send the response command back to the host, indicating successful communication
3) Module address setting command:
send out:00 06 00 00 00 01 49 DB(Example)/16Base system)
|
data |
byte |
Data Description |
notes |
|
00 |
1 |
Module address |
00-Mass mailing address |
|
06 |
1 |
function code |
06-Write single register |
|
0000 |
2 |
Register address(4xtype) |
0000-Modify module address |
|
0001 |
2 |
Write data |
Set new module address and range0001-00FE |
|
49 DB |
2 |
CRCCheck Code |
All the previous dataCRCCheck Code |
receive:00 06 00 00 00 01 49 DB(Example)/16Base system)
This command sends an instruction to a module to set its new address to01This setting can provide power loss protection
Storage; The default address for the module is01When multiple modules are needed for networking, the address of each module can be adjusted
Set it separately, as a group address is used, only one module is required in the network during setup
After receiving the correct command, the module takes corresponding actions according to the command and sends the response command back to the host
Communication successful
1) relay1close01 05 00 01 01 01 09
01address 05function code00 01Fixed code,01Close command 01 Relay number 09checksum
2) relay1break01 05 00 01 02 01 0A
01address 05function code00 01Fixed code,02Disconnect command 01 Relay number 09checksum
3) Swing command01 05 00 01 01 02 0A
4) Stop Swinging Command01 05 00 01 02 02 0B
5) Relay fully closed01 05 00 01 01 03 0B
6) Relay fully disconnected01 05 00 01 02 03 0C
7) write Closing time:01 06 00 C9 00 09 D9
01address 06function code00 C9Closing time address,0009 Closing time (unit)0.1Seconds)D9checksum
8) write Disconnect time:01 06 00 CA 00 08 D9
9) 01address 06function code00 CADisconnect the time address,0008 Disconnect time (unit)0.1Seconds)D9checksum
relay1close 01050001010109
relay1break0105000102010A
Swing command0105000101020A
Stop Swinging Command0105000102020B
10) Digital input signal acquisition command(2Byte by bit): Send: 01 02 00 00 00 10 79 C6(Example)/16Base system)
Switch input acquisition(2Byte by bit), maximum support16Road switch quantityDIinput
|
data |
byte |
Data Description |
notes |
|
01 |
1 |
Module address |
addresses01-FE |
|
02 |
1 |
function code |
02-Read input bits |
|
0000 |
2 |
Input Address(1xtype) |
0000-Enter the starting address of the input bit |
|
0010 |
2 |
Read input bit length |
0010-read16An input bit |
|
79C6 |
2 |
CRCCheck Code |
All the previous dataCRCCheck Code |
receive: 01 02 02 21 A0 A1 90(Example)/16Base system)
|
data |
byte |
Data Description |
notes |
|
01 |
1 |
Module address |
addresses01-FE |
|
02 |
1 |
function code |
02-Read input bits |
|
02 |
1 |
Byte count |
02-read2Byte length |
|
21A0 |
2 |
read data |
21A0-Read input bit status |
|
A190 |
2 |
CRCCheck Code |
All the previous dataCRCCheck Code |
The read data "21" is converted into a binary number "0010 0001", corresponding to 8 digits from left to right
The state of the input signal DI_08-DI_01 is measured, and the read data "A0" is converted to a binary number of "1010 0000",
From left to right, correspond to the states of 8 digital input signals DI_16-DI_09, namely DI_16 DI_14、
DI_06 and DI_01 have inputs, while other channels have no inputs.
11) Relay status acquisition command(2Byte by bit): Send01 03 00 00 00 01 84 0A(Example)/16Base system)
Relay status acquisition(2Byte by bit), maximum support16Road relay
|
data |
byte |
Data Description |
notes |
|
01 |
1 |
Module address |
addresses01-FE |
|
03 |
1 |
function code |
03-Read input bits |
|
0000 |
2 |
Relay address(1xtype) |
0000-Enter the starting address of the input bit |
|
0001 |
2 |
Read bit length |
0001-read16An input bit |
|
840A |
2 |
CRCCheck Code |
All the previous dataCRCCheck Code |
receive:return:01 03 02 03 fa 38 f7(Example)/16Base system)
|
data |
byte |
Data Description |
notes |
|
01 |
1 |
Module address |
addresses01-FE |
|
03 |
1 |
function code |
03-Read relay status |
|
02 |
1 |
Byte count |
02-read2Byte length |
|
03fa |
2 |
read data |
03faRead the status of the relay position |
|
38f7 |
2 |
CRCCheck Code |
All the previous dataCRCCheck Code |
Read data“03fa”,convert to2The base number is“0000 1010Corresponding from left to right respectively16Road relay statusRelay_16-Relay_01The state. relay1,3 close.11-16Closed, if the hardware only has10Road relay, high position10-15place0.
12) Relay control command(2Byte by bit, multiple controls): Send01 0F 00 00 00 10 02 21 86 7B D2(Example)/16Base system)
Relay control command(2Byte by bit, multiple controls), maximum support16Road relay
|
data |
byte |
Data Description |
notes |
|
01 |
1 |
Module address |
addresses01-FE |
|
0F |
1 |
function code |
0F-Force multiple coils |
|
0000 |
2 |
Coil address(0xtype) |
0000-Starting address of coil |
|
0010 |
2 |
Write the length of the coil |
0010-write16A coil |
|
2186 |
2 |
Write data |
2186-write16The output status of a coil |
|
7BD2 |
2 |
CRCCheck Code |
All the previous dataCRCCheck Code |
receive: 01 0F 00 00 00 10 54 07(Example)/16Base system)
|
data |
byte |
Data Description |
notes |
|
01 |
1 |
Module address |
addresses01-FE |
|
0F |
1 |
function code |
0F-Force multiple coils |
|
0000 |
2 |
Byte count |
address |
|
0010 |
2 |
read data |
2Byte length |
|
5407 |
2 |
CRCCheck Code |
All the previous dataCRCCheck Code |
The written data "21" is converted into a binary number "0010 0001", corresponding to 8 digits from left to right.
The state of the output signal DO_08-DO_01, the written data "86", is converted into a binary number "1000 0110",
From left to right, correspond to the states of 8 digital output signals DO_16-DO_09, namely DO_16 DO_11、
DO_10, DO_06, and DO_01 have outputs, while other channels have no outputs. After receiving the correct command, the module takes corresponding actions according to the command and sends the response command back to the host, indicating successful communication
1) Upper computer debugging instructions
This module provides an upper computer debugging software to achieve debugging and control functions. To avoid unnecessary damage, please strictly follow the following steps for operation:
Connect the computer and module using RS485 data cable
Connect the 12V or 24V external power supply to the module and power it on. Before powering on, please check if the positive and negative terminals of the power supply are connected correctly
Open the upper computer debugging software, set the correct communication parameters, and open the communication port
Select the corresponding module model, acquisition and control options

