Google Chat: zj734465502@gmail.com
+86-0755-88291180
sales01@spotpear.com
dragon_manager@163.com
services01@spotpear.com
manager01@spotpear.com
WhatsApp:13246739196
Power Supply | PoE Ethernet Port, DC 5.5*2.1 Power Port Or Power Supply Screw Terminal (7~36V) |
---|---|
Communication Interface | PoE Ethernet Port, Support IEEE 802.3af Standard |
Relay Channels | 8 Channels |
Touch Contact | 1NO, 1NC |
Touch Contact Load | ≤10A 250V AC Or ≤10A 30V DC |
Digital Input | 8DI, 5~36V, Passive Input/Active Input (NPN or PNP) Built-in Bidirectional Optocoupler |
Modbus Protocol | Modbus RTU Protocol Or Modbus TCP Protocol |
Indicator | Description |
---|---|
RUN | The network port operation indicator, when the network port is working normally, will output a square wave with a period of 2 seconds |
STA | MCU indicator, blinks when MCU is working normally |
TXD | Transmitting indicator, light on when transmitting data |
RXD | Receiving indicator, light on when receiving data |
Network port green indicator | Green indicator is on when TCP connection is established, used to determine if the module has established a communication link with the host computer software |
Network port yellow indicator | Data status indicator, blinking when transmitting data |
Supports reading digital input by sending Modbus RTU protocol commands, and can control relay output based on input.
Connect the Modbus POE ETH Relay (B) to the LAN via a network cable and power it via the 7~36V power port or power it via POE.
Vircom can be used for configuring device IP and other parameters, as well as creating virtual serial ports. If the virtual serial port functionality is not needed, you can simply download the installation-free version of the configuration software.
Driver installation requires decompression, double-click the software to install, if the virtual serial port in Vircom is not displayed, then reboot and check again.
After connecting to the Modbus POE ETH Relay, connect it to the network. Run the Vircom software, (The computer on which Vircom is installed must be on the same LAN as the module.).
The operation is shown below:
Device
Auto Search
Edit Device
or directly double click the searched device.Advanced settings
, the default setting is "None", that is, you select modbus rtu protocol. If you use Modbus_TCP protocol, you can select "modbus tcp protocol".Modify Setting
.Restart Dev
. After restarting the module, the new setting takes effect.As shown below:
The last step is to click "Modify Settings" to save the settings and take effect.
The SSCOM2 in the diagram communicates directly with the TCP and serial port server. In order to allow users to communicate with the serial port server using their existing serial port software, a virtual serial port needs to be added between the user program and the serial port server. As shown in the diagram, Vircom and the user program run on the same computer. Vircom virtualizes a COM port that corresponds to the serial port server. When the user program opens the COM communication, it can send data to the user's serial port device through the Vircom serial port server. The following steps demonstrate this operation:
Click on "Serial Port Management" on the Vircom main interface.
By default, data is transparently transmitted using the Modbus RTU protocol. If you need to implement Modbus TCP to RTU conversion, you need to select the conversion protocol as "Modbus TCP Protocol" in the device settings dialog, as shown in the diagram below. In this case, the device port automatically changes to 502. Users can connect their Modbus TCP tool to the IP of the serial port server on port 502, and the Modbus TCP commands they send will be converted to RTU commands and outputted through the serial port.
For example, if the server's Ethernet port receives a Modbus TCP command of 00 00 00 00 00 06 01 05 00 00 FF 00 (to turn on the first relay), the host controller will receive the Modbus RTU command of 01 05 00 00 FF 00 8C 3A.
If the error "A component named HEX0 already exists" is displayed, close the software and reopen it. Then close the software and reopen it, then re-import the file.
Using Vircom, you can search and configure device parameters in different network segments. For Web configuration, you must first ensure that the computer and the serial server are in the same IP segment, and you need to know the IP address of the serial server in advance. But web configuration can be done on any computer without Vircom.
1. Enter the IP address of the serial server in the browser, such as http://192.168.1.200
2. Enter password in "Password": There is no login password set by default in the factory, you can enter a password at will, and click the Login button to log in. After setting the password to log in, the settings at "Modify webpage login password" will take effect:
3. The serial server parameters can be modified on the web page that appears. For the relevant parameters, please refer to Table 4 for the meaning of the parameters.
4. After modifying the parameters, click the "Submit" button.
5. If the configuration web page files are overwritten during the configuration and downloading of MQTT and Jetson Modbus firmware, causing the configuration web page to be inaccessible, please follow these steps to re-download the web page files:
Connect the Raspberry Pi and the Modbus POE ETH Relay (B) module to the same LAN.
Open the Raspberry Pi terminal and run the program by entering the following command.
After the demo runs normally, each channel opens and closes in turn, and finally the current input status is displayed.
sudo apt-get install unzip wget https://files.waveshare.com/upload/d/d5/Modbus_POE_ETH_Relay_B_Code.zip unzip Modbus_POE_ETH_Relay_B_Code.zip cd Modbus_POE_ETH_Relay_B_Code #modbus rtu protocol vi modbus_rtu.py #Change the IP address and port number according to the actual situation sudo python3 modbus_rtu.py #modbus tcp protocol vi modbus_tcp.py #Change the IP address and port number according to the actual situation sudo python3 modbus_tcp.py
Function Code | Description |
---|---|
01 | Read Relay Status |
02 | Read Input Status |
03 | Read Register |
05 | Write Single Relay |
06 | Set Single Register |
0F | Write All Relays |
10 | Set Multiple Registers |
Address (HEX) | Address Storage Contents | Register Value | Permission | Modbus Function Code |
---|---|---|---|---|
0x0000 …… 0x0007 | 1~8 Channels relay address | 0xFF00: relay on; 0x0000: relay off; 0x5500: relay flips; | Read/Write | 0x01, 0x05, 0x0F |
0x00FF | Operate All Relays | 0xFF00: All relays on; 0x0000: All relays off; 0x5500: All relays flip | Write | 0x05 |
0x0100 …… 0x0107 | 1~8 Channels relay flip address | 0xFF00: Relay flips 0x0000: All relays not change | Write | 0x05, 0x0F |
0x01FF | All relys fip | 0xFF00: All relays flip 0x0000: All relays not change | Write | 0x05 |
0x0200 …… 0x0207 | 1~8 channels relay flash on | Delay time: data*100ms Value: 0x0007; Delay time: 7*100MS = 700MS | Write | 0x05 |
0x0400 …… 0x0407 | 1~8 channels relay flash off | Delay time: data*100ms Value: 0x0007; Delay time: 7*100MS = 700MS | Write | 0x05 |
1x0000 …… 1x0007 | 1~8 channels relay input address | 0~8 input channel status | Read | 0x02 |
4x1000 …… 4x1007 | 1~8 channels relay control mode | 0x0000~0x0002 | Read/Write | 0x03, 0x06, 0x10 |
4x4000 | Device Address | Directly store Modbus address Device address: 0x0001 | Read | 0x03 |
4x8000 | Software Version | Converting to decimal and shifting the decimal point two places to the left indicates the software version. 0x0064 = 100 = V1.00 | Read | 0x03 |
Send code: 01 05 00 00 FF 00 8C 3A
Field | Description | Note |
---|---|---|
01 | Device Address | Fixed 0x01 |
05 | 05 Command | Control Relays |
00 00 | Address | The register address of the relay to be controlled: 0x0000 - 0x0008 |
FF 00 | Command | 0xFF00: Relay on 0x0000: Relay off 0x5500: Relay flip |
8C 3A | CRC16 | CRC16 checksum of the first 6 bytes of data |
Return code: 01 05 00 00 FF 00 8C 3A
Field | Description | Note |
---|---|---|
01 | Device Address | Fixed 0x01 |
05 | 05 Command | Control Relays |
00 00 | Address | The register address of the relay to be controlled: 0x0000-0x0008 |
FF 00 | Command | 0xFF00: Relay on 0x0000: Relay off 0x5500: Relay flips |
8C 3A | CRC16 | CRC16 checksum of the first 6 bytes of data |
Example
[No.1 Adress Device]:
No.0 relay on: 01 05 00 00 FF 00 8C 3A No.0 relay off: 01 05 00 00 00 00 CD CA No.1 relay on: 01 05 00 01 FF 00 DD FA No.1 relay off: 01 05 00 01 00 00 9C 0A No.2 relay on: 01 05 00 02 FF 00 2D FA No.2 relay off: 01 05 00 02 00 00 6C 0A No.3 relay on: 01 05 00 03 FF 00 7C 3A No.3 relay off: 01 05 00 03 00 00 3D CA No.0 relay flips: 01 05 00 00 55 00 F2 9A No.1 relay flips: 01 05 00 01 55 00 A3 5A No.2 relay flips: 01 05 00 02 55 00 53 5A No.3 relay flips: 01 05 00 03 55 00 02 9A
Send: 01 05 00 FF FF 00 BC 0A
Field | Description | Note |
---|---|---|
01 | Device Address | Fixed 0x01 |
05 | 05 Command | Control Relays |
00 FF | Address | Fixed 0x00FF |
FF 00 | Command | 0xFF00: Relay on; 0x0000: Relay off 0x5500: Relay flips |
BC 0A | CRC16 | CRC16 checksum of the first 6 bytes of data |
Receive: 01 05 00 FF FF 00 BC 0A
Field | Description | Note |
---|---|---|
01 | Device Address | Fixed 0x01 |
05 | 05 Command | Control relays |
00 FF | Address | Fixed 0x00FF |
FF 00 | Command | 0xFF00: Relay on; 0x0000: Relay off; 0x5500: Relay flips |
BC 0A | CRC16 | CRC16 checksum of the first 6 bytes of data |
Example [No.1 Adress Device]:
All relays on: 01 05 00 FF FF 00 BC 0A All relays off: 01 05 00 FF 00 00 FD FA All relays flip: 01 05 00 FF 55 00 C2 AA
Send: 01 01 00 00 00 08 3D CC
Field | Description | Note |
---|---|---|
01 | Device Address | Fixed 0x01 |
01 | 01 Command | Query relay status |
00 00 | Start Address | Relay start address, 0x0000-0x0008 |
00 08 | Relay Count | Maximum quantity of relays cannot be exceeded |
3D CC | CRC16 | CRC16 checksum of the first 6 bytes of data |
Receive: 01 01 01 00 51 88
Field | Description | Note |
---|---|---|
01 | Device Address | Fixed 0x01 |
01 | 01 Command | Query relay status |
01 | Bytes Count | Returns all bytes of the status message |
00 | Queried Status | Returned Relay Status Bit0: starting relay status; Bit1: next relay status; And so on, high order bits are zero filled. |
8C 35 | CRC16 | CRC16 checksum of the first 6 bytes of data |
Example:
[No.1 Adress Device]:
Send: 01 01 00 00 00 08 3D CC //Query all relays Receive: 01 01 01 00 51 88 //All relays off Send: 01 01 00 02 00 01 5C 0A //Query No.2 relay Receive: 01 01 01 01 90 48 //No.1 relay on Send: 01 01 00 01 00 03 2D CB //Query No.1, 2, 3 relay status Receive: 01 01 01 05 91 8B //No.1, 3 relay on, No.2 relay off
Send: 01 0F 00 00 00 08 01 FF BE D5
Field | Description | Note |
---|---|---|
01 | Device Address | Fixed 0x01 |
0F | 0F Command | Write relay status |
00 00 | Starting address of relays | 0x0000-0x0008 |
00 08 | Quantity of Relays | Write the quantity of relays |
01 | Bytes Count | The status byte count |
FF | Relay Status | Bit0: the starting status of relays; Bit1: Next relay status; And so on, high order bits are zero filled |
BE D5 | CRC16 | CRC16 checksum of the first 6 bytes of data |
Receive: 01 0F 00 00 00 01 94 0B
Field | Description | Note |
---|---|---|
01 | Device Address | Fixed 0x01 |
0F | 0F Command | Control all registers |
00 00 | Address | The starting address of relays |
00 08 | Quantity of Relays | Write the quantity of relays |
54 0D | CRC16 | CRC16 checksum of the first 6 bytes of data |
Example
[No.1 Adress Device]:
All relays on: 01 0F 00 00 00 08 01 FF BE D5 All relays off: 01 0F 00 00 00 08 01 00 FE 95 0-1 on; 3-7 off: 01 0F 00 00 00 08 01 03 BE 94 No. 1,2,3 relay on: 01 0F 00 01 00 03 01 07 F3 55
Send: 01 05 02 00 00 07 8D B0
Field | Description | Note |
---|---|---|
01 | Device Address | Fixed 0x01 |
05 | 05 Command | Single control command |
02 | Command | 02: Flash on; 04: Flash off |
00 | Relay Address | Relay address to be controlled: 0x00~0x08 |
00 07 | Intervals | Delay time: data*100ms Value: 0x0007, Delay time: 7*100MS = 700MS |
8D B0 | CRC16 | CRC16 checksum of the first 6 bytes of data |
Receive: 01 05 02 00 00 07 8D B0
Field | Description | Note |
---|---|---|
01 | Device Address | Fixed 0x01 |
05 | 05 Command | Single control command |
02 | Command | 02: Flash on; 04: Flash off |
00 | Relay Address | Relay address to be controlled: 0x00~0x08 |
00 07 | Intervals | Delay time: data*100ms Value: 0x0007, Delay time: 7*100MS = 700MS |
8D B0 | CRC16 | CRC16 checksum of the first 6 bytes of data |
Note: The maximum time interval of flashing ON/OFF: 0x7FFF
Example
[No.1 Adress Device]: No.0 relay flash on: 01 05 02 00 00 07 8D B0 //700MS = 7*100MS = 700MS No.1 relay flash on: 01 05 02 01 00 08 9C 74 //800MS No.0 relay flash off: 01 05 04 00 00 05 0C F9 //500MS No.1 relay flash off: 01 05 04 01 00 06 1D 38 //600MS
Send: 01 02 00 00 00 08 79 CC
Field | Description | Note |
---|---|---|
01 | Device Address | Fixed 0x01 |
02 | 02 Command | Read input status command |
00 00 | the Starting Address of Inputs | 0x0000-0x0008 |
00 08 | Quantity of Registers | Read the quantity of input channels, not to exceed the maximum quantity of input channels |
79 CC | CRC16 | CRC16 checksum of the first 6 bytes of data |
Receive: 01 02 01 00 A1 88
Field | Description | Note |
---|---|---|
01 | Device Address | Fixed 0x01 |
02 | 02 Command | Read input status |
01 | Bytes Count | Returns all bytes of the status message |
00 | Queried Status | Returned input status Bit0: the starting input channels status Bit1: the status of the next channel And so on, with zero free bits at the high end of the scale. |
A1 88 | CRC16 | CRC16 checksum of the first 6 bytes of data |
Example:
[No.1 Adress Device]:
Send: 01 02 00 00 00 08 79 CC //Query all input channels Receive: 01 01 01 00 51 88 //Inputs are all untriggered Send: 01 02 00 00 00 08 79 CC //Query all input channels Receive: 01 02 01 41 61 B8 //1, 7 channel input trigger, the rest of the channel is not triggered Send: 01 02 00 01 00 02 A8 0B //Query 1,2,3 input channel Receive: 01 02 01 05 61 8B //1,2 channels input triggered, 2 channels not triggered
Send: 01 03 10 00 00 08 40 CC
Field | Description | Note |
---|---|---|
01 | Device Address | Fixed 0x01 |
03 | 03 Command | Read Holding Register |
10 00 | the starting address of registers | 0x1000 - 0x1007 corresponds to 1~8 input channels |
00 08 | Quantity of Registers | Read the quantity of registers, up to 8 channels |
40 CC | CRC16 | CRC16 checksum of the first 6 bytes of data |
Receive: 01 03 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 E4 59
Field | Description | Note |
---|---|---|
01 | Device Address | Fixed 0x01 |
03 | 03 Command | Read Holding Register |
10 | Bytes Count | Returns all bytes of the status message |
00 00 …… 00 00 | Control Mode | Indicates 1 - 8 relay control modes, 0x0000~0x0002 indicates three control modes 0x0000: Normal mode, directly control the relay with commands 0x0001: Linkage mode, Relay status is the same as the corresponding input channel status; 0x0002: Flip mode, input channel input a pulse corresponding to the relay state flip once 0x0002: Jump mode, the input channel level jumps once and the corresponding relay state flips once. |
E4 59 | CRC16 | CRC16 checksum of the first 6 bytes of data |
Example
[No.1 Adress Device]:
Read No.1-8 relay control mode: 01 03 10 00 00 08 40 CC Read No.1 relay control mode: 01 03 10 00 00 01 80 CA Read No.2 relay control mode: 01 03 10 01 00 01 D1 0A Read No.3-5号 relay control mode: 01 03 10 02 00 03 A0 CB
Send: 01 06 10 00 00 01 4C CA
Field | Description | Note |
---|---|---|
01 | Device Address | Fixed 0x01 |
06 | 06 Command | Write single register |
10 00 | the starting address of registers | 0x1000 - 0x1007 corresponds to 1~8 channel relay control modes |
00 01 | Control Mode | Indicates 1 - 8 relay control modes, 0x0000~0x0002 indicates three control modes 0x0000: normal mode, the relay is directly controlled by commands; 0x0001: Linkage mode, relay status is the same as the corresponding input channel status; 0x0002: flip mode, the input channel input a pulse and the corresponding relay flips once |
4C CA | CRC16 | CRC16 checksum of the first 6 bytes of data |
Receive: 01 06 10 00 00 01 4C CA
Field | Description | Note |
---|---|---|
01 | Device Address | Fixed 0x01 |
06 | 06 Command | Write single register |
10 00 | the starting address of registers | 0x1000 - 0x1007 corresponds to 1~8 channel relay control modes |
00 01 | Control Modes | Relay control mode, 0x0000~0x0002 indicate three control modes |
4C CA | CRC16 | CRC16 checksum of the first 6 bytes of data |
Example:
[No.1 Adress Device]: Set No.1 relay as linkage mode: 01 06 10 00 00 01 4C CA Set No.2 relay as flip mode: 01 06 10 01 00 02 5D 0B
Send: 01 10 10 00 00 08 10 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 7C B1
Field | Description | Note |
---|---|---|
01 | Device Address | Fixed 0x01 |
10 | 10 Command | Write multiple registers |
10 00 | Starting Address of Registers | 0x1000 - 0x1007 correspond to 1~8 channel relay control modes |
00 08 | Quantity of Registers | Set register numbers, up to 8 channels |
10 | Byte Count | Set output byte numbers |
00 01 …… 00 01 | Control Mode | Indicate 1 - 8 relay control modes, 0x0000~0x0003 indicates four control modes; 0x0000: normal mode, the relay is directly controlled through commands; 0x0001: linkage mode, Relay status is the same as the corresponding input channel status; 0x0002: Flip mode, input channel input a pulse corresponding to the relay state flip once; 0x0003: Jump mode, the input channel level jumps once and the corresponding relay state flips once. |
7C B1 | CRC16 | CRC16 checksum of the first 6 bytes of data |
Note: All modes except linkage mode support relay control by command.
Receive: 01 10 10 00 00 08 C5 0F
Field | Description | Note |
---|---|---|
01 | Device Address | Fixed 0x01 |
10 | 10 Command | Write multiple registers |
10 00 | Starting Address of Registers | 0x1000 - 0x1007 correspond to 1~8 channel relay control modes |
00 08 | Quantity of Registers | Set the quantity of registers, up to 8 channels |
C5 0F | CRC16 | CRC16 checksum of the first 6 bytes of data |
Example:
[No.1 Adress Device]: Set 1-8 channel relays as linkage mode: 01 10 10 00 00 08 10 00 01 00 01 00 01 00 01 00 01 00 01 00 01 00 01 7C B1 Set 3-5 channel relays as flip mode: 01 10 10 02 00 03 06 00 02 00 02 00 02 4A 4B
Send: 01 03 80 00 00 01 AD CA
Field | Description | Note |
---|---|---|
01 | Device Address | Fixed 0x01 |
03 | 03 Command | Read Holding Register |
80 00 | Command Register | 0x8000 reads the software version |
00 01 | Byte Count | Fixed 0x0001 |
AD CA | CRC16 | CRC16 checksum of the first 6 bytes of data |
Receive: 01 03 02 00 64 B9 AF
Field | Description | Note |
---|---|---|
01 | Device Address | Fixed 0x01 |
03 | 03 Command | Read Holding Register |
02 | Byte Count | Returns the number of bytes |
00 64 | Software Version | Converting to decimal and shifting the decimal point two places to the left indicates the software version 0x0064 = 100 = V1.00 |
F0 B8 | CRC16 | CRC16 checksum of the first 6 bytes of data |
Example:
Send: 01 03 80 00 00 01 AD CA Receive: 01 03 02 00 C8 B9 D2 //0x00C8 = 200 =V2.00
Here is a brief introduction to modbus tcp and modbus rtu protocol conversion using the above command to open the first relay as an example.
Field | Description | Note |
---|---|---|
01 | Device Address | Fixed 0x01 |
05 | 05 Command | Control relays |
00 00 | Address | Register address of the relay to be controlled, 0x00, the first relay |
FF 00 | Command | 0xFF00: Relay on |
8C 3A | CRC16 | CRC16 checksum of the first 6 bytes of data |
Field | Description | Note |
---|---|---|
00 00 | Message label | All 0x00 |
00 00 | modbus mark | All must be 0, indicate the modbus communication |
00 06 | Byte length | Indicates all the bytes that follow, followed by 6 more bytes |
01 | Device address | Fixed 0x01 |
05 | 05 Command | Control relays |
00 00 | Address | Register address of the relay to be controlled, 0x00, the first relay |
FF 00 | Command | 0xFF00: relay on |
Comparing the above commands reveals that the modbus rtu command removes the CRC checksum and adds five 0x00s and a byte length in front of it, which can be converted to the modbus tcp protocol.
-15℃~70℃.
Monday-Friday (9:30-6:30) Saturday (9:30-5:30)
Mobile: +86 13434470212
Email: services01@spotpear.com