• sales

    +86-0755-88291180

Modbus-POE-ETH-Relay-16CH User Guide

Overview

  • This product is an industrial grade dual Ethernet ports controlled 16-ch relay module, adopts Modbus RTU/Modbus TCP protocols, supports PoE power supply, also comes with ABS housing design. This relay module is very easy to use. Due to its fast communication, stability, reliability, and safety, it is an ideal choice for industrial control equipments and/or applications with high communication requirements.

Electrical Safety Precautions

  • This product should be operated and used by professional electricians or technical personnel. During use, please ensure electrical safety and take protective measures such as anti-leakage and insulation.
  • Before installing, maintaining, or replacing relay equipment, make sure to turn off the power and unplug the device.
  • Do not attempt to dismantle relay equipment to avoid damaging the device or risking electric shock.
  • Please properly install and place the relay equipment. Avoid using it in damp, overly hot, or flammable environments to prevent safety accidents due to improper installation or use.

Specifications

Power SupplyPoE network port, DC 5.5*2.1 power connector or terminal block (7~36V)
Communication InterfacePoE network port, supports IEEE 802.3af standard
Relay Channels16 Channels
Contact Form1NO 1NC
Contact Load≤10A 250V AC 或 ≤10A 30V DC
Modbus ProtocolModbus RTU protocol or Modbus TCP protocol

Indicator Light Description

IndicatorStatus description
RUN indicatorEthernet port running indicator, outputs a square wave with a period of 2 seconds when the Ethernet port working normally.
STA indicatorMCU indicator, blinking when the MCU working normally.
TXD indicatorSend indicator, lights up when sending data.
RXD indicatorReceive indicator, lights up when receiving data.
Green light on left Ethernet portLights up when port 1 connected to the Ethernet
Green light on right Ethernet portLights up when port 2 connected to the Ethernet
Yellow light on left Ethernet portThe yellow indicator will be on when TCP connection is established, which can be used to determine whether the module has established a communication link with the host software
Yellow light on right Ethernet portData activity indicator, when data is transmitted through the Ethernet port, the yellow indicator changes its state, which can be used to determine if there is data transmission

Hardware Connection


  • Connect the module to the LAN via a network cable, and supply power through 7~36V power port or the POE. Both Ethernet ports are functionally the same and can be used for network port communication and cascading.

Module Parameter Configuration

The module needs to set the module parameters before communication, such as IP address, serial port format, Modbus protocol, etc. There are two modes of setting parameters: Vircom software configuration and web configuration.
Vircom software configuration allows for setting more parameters, but requires software installation. Web configuration does not require installation, but you need to know the IP address first, and the configuration parameters are few. It is recommended to use Virom for configuration.
Note:
1. The configuration can be done in any way, and it is recommended to use Virom software for first test.
2. It is recommended to modify only the IP address for the first configuration, other parameters are not recommended to be modified. The serial port parameters must be the default parameters; modifying the serial port parameters will result in no communication.
3. The module supports both Modbus RTU and Modbus TCP protocols. In the Advanced Settings -> Transfer Protocol, you can choose “None”, which means the Modbus RTU protocol. It is not recommended to modify during the first configuration.
4. The selected Modbus TCP protocol must be configured using the Virom software and set to a non-storage Modbus gateway, otherwise the communication will not be normal.

Virom Software Mode Configuration

General Settings

Connect the module to the hardware and 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 as follows:

  • ① Click Device
  • ② Click Auto Search
  • ③ The software searches for and identifies devices connected to the LAN
  • ④ Select the device, and then click Edit Device or double-click the searched device directly
  • ⑤ Set the working parameters of the device:
    • Click the "Local IP" button to identify the IP address of the computer, modify the "IP address" to a static assigned address, and note that the static IP address entered is not used by other devices, and it needs to be on the same LAN as the computer.
    • The working mode is TCP server. The serial port setting is 115200 by default and cannot be modified.
    • The "Transfer Protocol" in "Advanced Settings" defaults to "None", which means using the Modbus RTU protocol; if you select "Modbus TCP protocol", then use the Modbus TCP protocol for communication.
  • ⑥ Once the settings are complete, click Modify Setting
  • ⑦ Click Restart Dev, wait for the module to restart, and the new settings will take effect.

Note: It is recommended to modify only the IP address for the first configuration, and do not modify other parameters.
See the figure below for details:

Protocol Setting

Note: It is recommended to use the default Modbus RTU protocol for the first configuration and no modifications are needed.
Although the module transmits data through the network port, it supports two Modbus protocols: Modbus RTU and Modbus TCP. By default, data is transparently transmitted, i.e. using the Modbus RTU protocol.
The "Transfer Protocol" in the "Advanced Settings" can be set to Modbus TCP protocol. In this case, the Modbus RTU protocol of the main controller will be converted to the Modbus TCP protocol and transmitted through the network port.
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.

  • If set to Modbus TCP protocol, it also needs to be set to a non-storage Modbus network port. Click on "More Advanced Settings..." and select the Modbus Gateway Type as a non-storage Modbus gateway.

Note: The default Modbus gateway type is storage type, which will automatically send query commands several times, which may cause the controller chip not to respond, and the query commands will not be affected. Therefore, you need to set it as Multi-host non-storage type. 

Virtual Serial Port Setting

The module transmits data through a network port (TCP/UDP protocol). In order to enable users to communicate even with developed serial port software, a virtual serial port needs to be added. If not needed, this part can be skipped.
First, install the virtual serial driver Virtual serial port driver, and run Vircom and the user program 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 & Device Management" on the Vircom main interface, then click "Add" and select to add COM2 (Among them, COM2 is the newly emerging COM port on the computer).

  • Then enter the device management and double-click the device that needs to be bound to COM2. As shown in the diagram, select COM2 from the Virtual Serial Port list in the top left corner. Then click on "Modify Setting" and then click on "Restart Device".


  • Return to the main interface of Vircom. It can be seen that COM2 has been connected to the device whose IP is 192.168.1.200. In this case, the virtual serial port COM2 can be used instead of the network port for communication.


WEB Configuration

Using Vircom, you can search for 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. (Different products have different web interfaces, which can be switched between Chinese and English)
1. Enter the IP address of the serial server in the browser, such as http://192.168.1.200 to open the following web page

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 Web Login Key" will take effect:

3. The serial server parameters can be modified on the web page that appears.
4. After modifying the parameters, click the "Submit" button.
Attention: The system has added webpage settings function by default when it leaves the factory. If the configuration interface page file is overwritten and the webpage cannot be opened, the webpage file needs to be downloaded again.
Please refer to RS485 TO ETH (B) Manual

Example Demonstration

The demo shows how the following two software operate.
SSCOM serial port debugging assistant is more convenient to operate, free of installation, and more convenient for complete display and analysis of instructions, but the disadvantage is that the data is not intuitive.
Modbus Poll software is directly operated on the register, and the data display is more convenient to observe, but the disadvantage is that the instruction is not displayed completely, so you need to be familiar with the Modbus register operation.
You can test using any method. It is recommended to use the SSCOM serial port debugging assistant software for the first test.

SSCOM Serial Port Debugging Assistant

  • Open the serial debugging assistant window, select TCPClient for the port number, modify the remote IP and port number according to the above Vircom settings, select ModbusCRC16 if you need to add the check. Click the "Connect" button to connect to the TCP server, the green light of the network port will light up after successful connection.


Click Multi-Char to open the Send Multi-Char window, the default display is the Modbus RTU command, and there is no CRC check, select ModbusCRC16 if you need to add the check. Click on the function to send the corresponding command.

  • The default configuration is Modbus RTU command. If set to Modbus TCP command, the command needs to be changed. *Click on the Import ini button in the Send Multi-Char column, and select the Modbus tcp.ini file to import.

If the error "A component named HEX0 already exists" is displayed, close the software and reopen it, then re-import the file.

  • After successful import, the following is displayed, click on the function to send the corresponding command.

Note: Modbus tcp does not require CRC checksum, select None for checksum.

  • For detailed Modubs commands, please see the development protocol.

Modbus Poll Software

  • The serial port software is not convenient to observe the data, you can choose Modbus Poll software to read the data. Download and install the Modbus Poll software.
  • Open the software, select Setup->Read/Write Definition, select the actual device address for Slave ID, select 01 Read Coils function code for Function, and change Quantity to 16 channels. Click OK to confirm.


  • Select Connection->Connect..., select Modbus RTU/ASCII Over TCP/IP for Connection, select RTU for Mode, and enter the correct IP address and port number. Click OK to connect.


  • After the connection is normal, you can check the current relay status. Select the corresponding channel, then double-click the status value to pop up the send page. Choose On or Off, then Click Send to control the relay opening and closing.


Modbus RTU Development Protocol

Function Code Introduction

Function CodeDescriptionNote
01Read coil statusRead relay status
03Read holding registerRead the address and version
05Write single coilWrite single relay
06Write single registerSet the baud rate and address
0FWrite multiple coilsWrite all relays

Register Address Introduction

Address (HEX)Address storage contentRegister valuePermissionModbus Function Code
0x0000
……
0x000F
Channel 1~16 relay address0xFF00: relay on
0x0000: relay off
0x5500: relay toggle
Read/Write0x01, 0x05, 0x0F
0x00FFControl all relays0xFF00: all relays on
0x0000: all relays off
0x5500: all relays toggle
Write0x05
0x0100
……
0x010F
Channel 1~16 relay toggle0xFF00: relay toggle
0x0000: relay unchanged
Write0x05, 0x0F
0x01FFAll relays toggle0xFF00: all relays toggle
0x0000: all relays unchanged
Write0x05
0x0200
……
0x020F
Channel 1~16 relay flash onInterval time: data*100ms
Value: 0x0007, Interval time: 7*100MS = 700MS
Write0x05
0x0400
……
0x040F
Channel 1~16 relay flash offInterval time: data*100ms
Value: 0x0007, Interval time: 7*100MS = 700MS
Write0x05
4x4000Device AddressDirectly store Modbus address
Device address: 0x0001
Read0x03
4x8000Software VersionConverting to decimal and then shifting the decimal point two places to the left will represent the software version
0x0064 = 100 = V1.00
Read0x03

Modbus RTU Command Introduction

Control Single Relay

Send code: 01 05 00 00 FF 00 8C 3A

FieldDescriptionNote
01Device Address0x00 indicates the broadcast address, 0x01-0xFF indicates the device address
0505 CommandRelay control
00 00AddressThe register address of the relay to be controlled, 0x0000-0x000F
FF 00Command0xFF00: relay on;
0x0000: relay off;
0x5500: relay toggle
8C 3ACRC16The CRC16 checksum of the first 6 bytes of data

Return code: 01 05 00 00 FF 00 8C 3A

FieldDescriptionNote
01Device Address0x00 indicates the broadcast address, 0x01-0xFF indicates the device address
0505 CommandRelay control
00 00AddressThe register address of the relay to be controlled, 0x0000-0x000F
FF 00Command0xFF00: relay on;
0x0000: relay off;
0x5500: relay toggle
8C 3ACRC16The CRC16 checksum of the first 6 bytes of data

For example: [Address 1 device]:

Relay 0 on: 01 05 00 00 FF 00 8C 3A
Relay 0 off: 01 05 00 00 00 00 CD CA
Relay 1 on: 01 05 00 01 FF 00 DD FA
Relay 1 off: 01 05 00 01 00 00 9C 0A
Relay 2 on: 01 05 00 02 FF 00 2D FA
Relay 2 off: 01 05 00 02 00 00 6C 0A
Relay 3 on: 01 05 00 03 FF 00 7C 3A
Relay 3 off: 01 05 00 03 00 00 3D CA
Relay 0 toggle: 01 05 00 00 55 00 F2 9A
Relay 1 toggle: 01 05 00 01 55 00 A3 5A
Relay 2 toggle: 01 05 00 02 55 00 53 5A
Relay 3 toggle: 01 05 00 03 55 00 02 9A

Control All Relays

Send code: 01 05 00 FF FF 00 BC 0A

FieldDescriptionNote
01Device Address0x00 indicates the broadcast address, 0x01-0xFF indicates the device address
0505 CommandRelay control
00 FFAddressFixed 0x00FF
FF 00Command0xFF00: relay on;
0x0000: relay off;
0x5500: relay toggle
BC 0ACRC16The CRC16 checksum of the first 6 bytes of data

Return code: 01 05 00 FF FF 00 BC 0A

FieldDescriptionNote
01Device Address0x00 indicates the broadcast address, 0x01-0xFF indicates the device address
0505 CommandRelay control
00 FFAddressFixed 0x00FF
FF 00Command0xFF00: relay on;
0x0000: relay off;
0x5500: relay toggle
BC 0ACRC16The CRC16 checksum of the first 6 bytes of data

For example: [Address 1 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 toggle: 01 05 00 FF 55 00 C2 AA

Read Relay Status

Send code: 01 01 00 00 00 10 3D C6

FieldDescriptionNote
01Device Address0x00 indicates the broadcast address, 0x01-0xFF indicates the device address
0101 CommandQuery relay status
00 00Relay Start AddressThe register address of the relay, 0x0000 - 0x000F
00 10Relay NumberThe number of relays to be read, which must not exceed the maximum number of relays
3D C6CRC16The CRC16 checksum of the first 6 bytes of data

Receive code: 01 01 02 00 00 B9 FC

FieldDescriptionNote
01Device Address0x00 indicates the broadcast address, 0x01-0xFF indicates the device address
0101 CommandQuery relay status
02Byte NumberThe number of all bytes of the returned status information
00 00Query statusReceived relay status
The relay state is in small-endian format, with low bytes first and high bytes last
Bit0: the first relay status;
Bit1: the second relay status;
And so on, with the idle high bit being zero
B9 FCCRC16The CRC16 checksum of the first 6 bytes of data

For example: [Address 1 device]

Send: 01 01 00 00 00 10 3D C6       //Query all relays
Receive: 01 01 02 00 00 B9 FC       //All relays off
Send: 01 01 00 01 00 03 2D CB       //Query relays 1, 2, 3 status
Receive: 01 01 01 05 91 8B          //Relays 1 and 3 are on, relay 2 is off
Send: 01 01 00 04 00 0C 7D CE       //Query relays 4-15
Receive: 01 01 02 0F 00 BC 0C       //Relays 4-7 are on, relays 8-15 are off

Write Relay Status

Send code: 01 0F 00 00 00 10 02 FF FF E3 90

FieldDescriptionNote
01Device Address0x00 indicates the broadcast address, 0x01-0xFF indicates the device address
0F0F CommandWrite relay status
00 00Relay Start AddressThe register address of the relay to be controlled, 0x0000 - 0x000F
00 10Relay NumberThe number of relays to be operated, which must not exceed the maximum number of relays
02Byte NumberThe byte number of the status
FF FFRelay statusThe relay state is in small-endian format, with low bytes first and high bytes last
Bit0: the first relay status;
Bit1: the second relay status;
And so on, with the idle high bit being zero
E3 90CRC16The CRC16 checksum of the first 6 bytes of data

Receive code: 01 0F 00 00 00 10 54 07

FieldDescriptionNote
01Device Address0x00 indicates the broadcast address, 0x01-0xFF indicates the device address
0F0F CommandControl all registers
00 00Relay Start AddressThe register address of the relay to be controlled, 0x0000 - 0x0008
00 10Relay NumberThe number of relays to be operated
54 07CRC16The CRC16 checksum of the first 6 bytes of data

For example: [Address 1 device]

All relays on: 01 0F 00 00 00 10 02 FF FF E3 90
All relays off: 01 0F 00 00 00 10 02 00 00 E2 20
0-1 on; 3-15 off: 01 0F 00 00 00 10 02 03 00 E2 D0

Relay Flash ON/OFF Command

Send code: 01 05 02 00 00 07 8D B0

FieldDescriptionNote
01Device Address0x00 indicates the broadcast address, 0x01-0xFF indicates the device address
0505 CommandSingle control command
02Flash on flash off02: flash on, 04: flash off
00Relay AddressThe address of the relay to be controlled, 0x00~0x0F
00 07Interval TimeThe interval time: data*100ms
Value: 0x0007, Interval time: 7*100MS = 700MS
The maximum setting for the flash-on flash-off time is 0x7FFF
8D B0CRC16The CRC16 checksum of the first 6 bytes of data

Receive code: 01 05 02 00 00 07 8D B0

FieldDescriptionNote
01Device Address0x00 indicates the broadcast address, 0x01-0xFF indicates the device address
0505 CommandSingle control command
02Flash on flash off02: flash on, 04: flash off
00Relay AddressThe address of the relay to be controlled, 0x00~0x0F
00 07Interval TimeThe interval time: data*100ms
Value: 0x0007, Interval time: 7*100MS = 700MS
The maximum setting for the flash-on flash-off time is 0x7FFF
8D B0CRC16The CRC16 checksum of the first 6 bytes of data

For example: [Address 1 device]

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

Read Software Version Command

Send code: 01 03 80 00 00 01 AD CA

FieldDescriptionNote
01Device Address0x00 indicates the broadcast address, 0x01-0xFF indicates the device address
0303 CommandRead the software version and device address
80 00Software version register0x4000: read the device address, 0x8000: read software version
00 01Byte NumberFixed 0x0001
AD CACRC16The CRC16 checksum of the first 6 bytes of data

Receive code: 01 03 02 01 2C B8 09

FieldDescriptionNote
01Device Address0x00 indicates the broadcast address, 0x01-0xFF indicates the device address
0303 CommandRead the software version and device address
02Byte NumberThe number of bytes returned
01 2CSoftware VersionConverting to decimal and then shifting the decimal point two places to the left will represent the software version


0x012C = 300 = V3.00

B8 09CRC16The CRC16 checksum of the first 6 bytes of data

For example:

Send: 01 03 80 00 00 01 AD CA
Receive: 01 03 02 01 2C B8 09       //0x012C = 300 =V3.00

Exception Function Code

When the received command is incorrect or the device is abnormal, an exception response will be returned in the following format:

Receive: 01 85 03 02 91

FieldDescriptionNote
01Device Address0x00 indicates the broadcast address, 0x01-0xFF indicates the device address
85Exception Function CodeException function code = Request function code + 0x80
03Byte NumberException Code
02 91CRC16The CRC16 checksum of the first 6 bytes of data

An exception code is a single-byte value that indicates the type of error. Several commonly used exception codes defined by the Modbus protocol:

Exception CodeNameDescription
0x01Illegal FunctionThe requested function code is not supported
0x02Illegal Data AddressThe requested data address is incorrect
0x03Illegal Data ValueThe requested data value or operation cannot be executed
0x04Server FailureServer equipment failure
0x05ResponseThe request has been received and is being processed
0x06Device BusyThe device is currently busy and cannot perform the requested operation

Modbus TCP Development Protocol

Here is a brief introduction to Modbus TCP and Modbus RTU protocol conversion using the above commands to open the first relay as an example.

  • Modbus RTU command: 01 05 00 00 FF 00 8C 3A
FieldDescriptionNote
01Device AddressFixed 0x01
0505 CommandRelay control
00 00AddressThe register address of the relay to be controlled, 0x00, that is, the first relay
FF 00Command0xFF00: Relay on
8C 3ACRC16The CRC16 checksum of the first 6 bytes of data
  • Modbus TCP command: 00 00 00 00 00 06 01 05 00 00 FF 00
FieldDescriptionNote
00 00Message LabelBoth be 0x00
00 00modbus LabelMust both be 0, which means this is Modbus communication
00 06Byte LengthIndicates the number of all bytes that follow, followed by 6 bytes
01Device AddressFixed 0x01
0505 CommandRelay control
00 00AddressThe register address of the relay to be controlled, 0x00, that is, the first relay
FF 00Command0xFF00: Relay on

By comparing the commands above, we can observe that to convert a Modbus RTU command to Modbus TCP protocol, the CRC check is removed, and the command is prefixed with five 0x00 bytes followed by a byte representing the length.

Advanced Applications - MQTT Connected Cloud Platform

Resources

Demo

Softwares

FAQ

Question: I forgot the parameters set by Vircom for the network port, how can I restore the factory settings?

 Answer:
  • To restore the setting parameters of the network port, you need to disassemble the shell, use tweezers to short the pad under the DEF silk screen for more than 5s, and the module will be reset to the IP of 192.168.1.254.


Question: What is the operating temperature range of the relay?

 Answer:

Operating temperature: -15℃ ~ 70℃


Support

Monday-Friday (9:30-6:30) Saturday (9:30-5:30)

Email: services01@spotpear.com