Ebyte ME31-AAAX2240 User manual

ME31-AAAX2240
Network I/O Networking Module
This manual may be updated with product improvements, please refer to the latest version of the
manual! Chengdu Yibaite Electronic Technology Co., Ltd. reserves the final interpretation and
modification rights for all contents in this instruction!

Chengdu Ebyte Electronic Technology Co.,Ltd. ME31-AAAX2240_UserManual_EN
Copyright ©2012–2023, Chengdu Ebyte Electronic Technology Co.,Ltd 1
Contents
I. Overview ..................................................................................................................................................................... 3
1.1 Product Introduction .........................................................................................................................................3
1.2 Functional Features .......................................................................................................................................... 3
1.3 Product Application Topology Diagram .......................................................................................................... 4
II.Quick use .................................................................................................................................................................... 5
2.1 Device preparation ........................................................................................................................................... 5
2.2 Device connection ............................................................................................................................................ 6
2.2.1 RS485 connection ................................................................................................................................. 6
2.2.2 AI analog input connection ................................................................................................................... 7
2.2.3. DI switch input connection .................................................................................................................. 7
2.2.4. Relay output connection .......................................................................................................................7
2.2.5 Simple use ............................................................................................................................................. 8
2.3 Parameter Configuration .................................................................................................................................. 8
2.4 Control Testing ................................................................................................................................................. 9
2.4.1 Modbus TCP control ............................................................................................................................. 9
2.4.2 Modbus RTU control ...........................................................................................................................10
III. Technical Specification ...........................................................................................................................................11
3.1 Specifications ..................................................................................................................................................11
3.2 Device Default Parameters .............................................................................................................................12
3.3 Mechanical Dimensional Drawing .................................................................................................................13
3.4 Port and indicator light description ................................................................................................................14
IV. Product Function Introduction ................................................................................................................................16
4.1 DI Input .......................................................................................................................................................... 16
4.1.1. Switch Input DI Collection ................................................................................................................ 16
4.1.2. Input filtering ......................................................................................................................................16
4.2 AI Input ...........................................................................................................................................................16
4.2.1. Analog range .......................................................................................................................................16
4.2.2. Trigger mode ...................................................................................................................................... 17
4.2.3. Engineering quantity shaping value and engineering quantity floating point value of analog input 17
4.2.4. AI filter parameters .............................................................................................................................17
4.3 DO output ....................................................................................................................................................... 18
4.3.1. Input count ..........................................................................................................................................18
4.3.2. Level output ........................................................................................................................................18
4.3.3. Pulse output ........................................................................................................................................ 18
4.3.4. Follow mode .......................................................................................................................................18
4.3.5. Reverse follow mode ..........................................................................................................................19
4.3.6. Trigger toggle mode ........................................................................................................................... 19
4.3.7. Power-on state .................................................................................................................................... 19
4.4 Modbus Gateway ............................................................................................................................................19
4.4.1. Modbus TCP/RTU protocol conversion ............................................................................................ 19
4.4.2. Modbus Address Filtering ..................................................................................................................19

Chengdu Ebyte Electronic Technology Co.,Ltd. ME31-AAAX2240_UserManual_EN
Copyright ©2012–2023, Chengdu Ebyte Electronic Technology Co.,Ltd 2
4.4.3. Modbus TCP Protocol Data Frame Description ................................................................................ 20
4.4.4. Modbus RTU protocol data frame description .................................................................................. 20
4.5 IO linkage function .........................................................................................................................................20
4.6 Active upload ..................................................................................................................................................21
4.7 Custom Module Information ..........................................................................................................................21
4.7.1. Modbus Address .................................................................................................................................21
4.7.2. Module Name .....................................................................................................................................21
4.7.3. Network parameters ........................................................................................................................... 21
4.7.4. Serial Port Parameters ........................................................................................................................ 22
4.8 OLED display and parameter configuration .................................................................................................. 22
4.8.1. Information Display Interface ............................................................................................................22
4.8.2. Equipment parameter display interface ............................................................................................. 23
4.8.3. Equipment Parameter Configuration Interface .................................................................................. 23
4.8.4. Screen Sleep ....................................................................................................................................... 24
4.9 MODBUS parameter configuration ............................................................................................................... 24
4.9.1. DI Register List .................................................................................................................................. 24
4.9.2. List of AI Registers ............................................................................................................................ 25
4.9.3. List of DO Registers ...........................................................................................................................25
4.9.4. Module related registers .....................................................................................................................26
4.9.5. Network related registers ................................................................................................................... 27
4.9.6. Examples of Modbus command operation instructions .....................................................................28
V. Configuration Software ............................................................................................................................................31
5.1. Acquisition and Control ................................................................................................................................ 31
5.2. Parameter configuration interface .................................................................................................................32

Chengdu Ebyte Electronic Technology Co.,Ltd. ME31-AAAX2240_UserManual_EN
Copyright ©2012–2023, Chengdu Ebyte Electronic Technology Co.,Ltd 3
I. Overview
1.1 Product Introduction
ME31-AAAX2240 is equipped with 4-way A-type relay output, 2-way
analog (0-20mA/4-20mA) input, 2-way dry contact input detection, and
supports Modbus TCP protocol or Modbus RTU protocol for acquisition and
control. At the same time, the device is also a network I/O networking module
that can be used as a simple Modbus gateway (automatically send commands
with non-local Modbus addresses through the serial port/network port).
1.2 Functional Features
Support standard Modbus RTU protocol and Modbus TCP protocol;
Support various configuration software/PLC/touch screen;
RS485 acquisition control I/O;
RJ45 acquisition control I/O, support 4-way host access;
Support OLED display to display status information, and configure device parameters through buttons;
2-way analog input (0-20mA/4-20mA);
2-way switch input DI (dry node);
4-way switch output DO (Type A relay);
Switch output (DO) supports level mode, pulse mode, follow mode, reverse follow mode, trigger flip mode;
Support custom Modbus address setting;
Support 8 common baud rate configurations;
Support DHCP and static IP;
Support DNS function, domain name resolution;
Support Modbus gateway function;
Support input and output linkage;

Chengdu Ebyte Electronic Technology Co.,Ltd. ME31-AAAX2240_UserManual_EN
Copyright ©2012–2023, Chengdu Ebyte Electronic Technology Co.,Ltd 4
1.3 Product Application Topology Diagram
Network interface application topology diagram
Serial port application topology diagram

Chengdu Ebyte Electronic Technology Co.,Ltd. ME31-AAAX2240_UserManual_EN
Copyright ©2012–2023, Chengdu Ebyte Electronic Technology Co.,Ltd 5
II.Quick use
【Note】This test needs to be carried out with the default factory parameters.
2.1 Device preparation
The following table lists the items required for this test:
ME31-AAAX2240
12V switching power
supply
USB to RS485 Cable
A computer
A network cable
Several cables

Chengdu Ebyte Electronic Technology Co.,Ltd. ME31-AAAX2240_UserManual_EN
Copyright ©2012–2023, Chengdu Ebyte Electronic Technology Co.,Ltd 6
2.2 Device connection
2.2.1 RS485 connection
Note: When the 485 bus high-frequency signal is transmitted, the signal wavelength is shorter than the transmission
line, and the signal will form a reflected wave at the end of the transmission line, which will interfere with the original
signal. Therefore, it is necessary to add a terminal resistor at the end of the transmission line so that the signal does not
reflect after reaching the end of the transmission line. The terminal resistance should be the same as the impedance of the
communication cable, the typical value is 120 ohms. Its function is to match the bus impedance and improve the
anti-interference and reliability of data communication.
External power supply
ME31 Device
User’s RS485 Device

Chengdu Ebyte Electronic Technology Co.,Ltd. ME31-AAAX2240_UserManual_EN
Copyright ©2012–2023, Chengdu Ebyte Electronic Technology Co.,Ltd 7
2.2.2 AI analog input connection
2.2.3. DI switch input connection
2.2.4. Relay output connection
Signal Generator/Sensor
Dry contact
Load

Chengdu Ebyte Electronic Technology Co.,Ltd. ME31-AAAX2240_UserManual_EN
Copyright ©2012–2023, Chengdu Ebyte Electronic Technology Co.,Ltd 8
2.2.5 Simple use
Wiring: The computer is connected to the RS485 interface of ME31-AAAX2240 through USB to RS485, A is
connected to A, and B is connected to B.
Networking: Insert the network cable into the RJ45 port and connect to the PC.
Power supply: Use DC-12V switching power supply (DC 8~28V) to power ME31-AAAX2240.
2.3 Parameter Configuration
Step 1: Modify the IP address of the computer to be consistent with the device. Here I am modifying it to
192.168.3.100 to ensure that it is on the same network segment as the device and that the IP is different. If you
cannot connect to the device after the above steps, please turn off the firewall and try again;
Step 2: Open the network assistant, select the TCP client, enter the remote host IP192.168.3.7 (default parameter),
enter the port number 502 (default parameter), and select HEX to send.
Network port

Chengdu Ebyte Electronic Technology Co.,Ltd. ME31-AAAX2240_UserManual_EN
Copyright ©2012–2023, Chengdu Ebyte Electronic Technology Co.,Ltd 9
2.4 Control Testing
2.4.1 Modbus TCP control
Use the network assistant to control the first DO output of ME31-AAAX2240.
Other functions can be tested through the commands in the table below.
Function (function code)
Command
The device is in server mode, and the
computer connects to the device as a client.
Enter the IP address of the device.
Enter the port number of the device.
Select HEX display to facilitate observation
of data.
Select HEX to send
1: Transaction ID
2: Protocol identifier
3: Length
4: Modbus address
5: Function code
6: First address
7: Opcode

Chengdu Ebyte Electronic Technology Co.,Ltd. ME31-AAAX2240_UserManual_EN
Copyright ©2012–2023, Chengdu Ebyte Electronic Technology Co.,Ltd 10
Pull in the first coil (0x05)
01 00 00 00 00 06 01 05 00 00 FF 00
Full open command (0x0F)
02 00 00 00 00 08 01 0F 00 00 00 04 01 0F
Full close command (0x0F)
02 00 00 00 00 08 01 0F 00 00 00 04 01 00
Read all DI status (0x02)
01 00 00 00 00 06 01 02 00 00 00 02
Read all DO status (0x01)
01 00 00 00 00 06 01 01 00 00 00 04
2.4.2 Modbus RTU control
Use the serial port assistant to control the first DO output of ME31-AAAX2240.
Other functions can be tested through the commands in the table below.
Function (function code)
Command
Pull in the first coil (0x05)
01 05 00 00 FF 00 8C 3A
Full open command (0x0F)
01 0F 00 00 00 04 01 0F 7E 92
Full close command (0x0F)
01 0F 00 00 00 04 01 00 3E 96
Read all DI status (0x02)
01 02 00 00 00 02 F9 CB
Read all DO status (0x01)
01 01 00 00 00 04 3D C9

Chengdu Ebyte Electronic Technology Co.,Ltd. ME31-AAAX2240_UserManual_EN
Copyright ©2012–2023, Chengdu Ebyte Electronic Technology Co.,Ltd 11
III. Technical Specification
3.1 Specifications
Category
Name
Parameters
Power supply
Operating Voltage
DC8~28V
Power indicator
Blue LED indication
Serial port
Communication
Interface
RJ45, RS485
Baud rate
9600bps (customizable)
Protocol
Standard Modbus TCP, Modbus RTU protocol
MODBUS
Device address
Can be modified by Modbus command and host
computer
DI input
Number of DI
channels
2 way
Input type
Default dry contact
Acquisition
frequency
1 kHz
Input instructions
OLED screen display, red LED indication
AI input
AI channels
2 way
Acquisition
Features
Single-ended input
Input type
0-20mA, 4-20mA
AI resolution
3‰
Acquisition
frequency
10Hz
Input instructions
OLED screen display
DO output
Number of DO
channels
4 way
DO output type
Form A relay
DO output mode
Level output, pulse output
Relay contact
capacity
30V/5A、250V/5A
Output indication
OLED screen display, red LED indication
Other
Product Size
121mm * 72mm * 34mm (L*W*H)
Product weight
145±5g
Working
temperature and
humidity
-40 ~+85℃, 5% ~95%RH (no condensation)
Storage
-40 ~+105℃, 5% ~95%RH (no

Chengdu Ebyte Electronic Technology Co.,Ltd. ME31-AAAX2240_UserManual_EN
Copyright ©2012–2023, Chengdu Ebyte Electronic Technology Co.,Ltd 12
temperature and
humidity
condensation)
Installation method
Din-rail installation
3.2 Device Default Parameters
Category
Name
Parameters
Ethernet parameters
Operating mode
TCP server (up to 4-way client
access)
Local IP
192.168.3.7
Local port
502
Subnet mask
255.255.255.0
Gateway address
192.168.3.1
DHCP
Close
Native MAC
Determined by the chip (fixed)
Target IP
192.168.3.3
Target port
502
DNS server
114.114.114.114
Active upload
Close
Serial parameters
Baud rate
9600bps (8 types)
Check method
None (default), Odd, Even
Data bit
8
Stop bit
1
MODBUS parameter
Modbus master-slave
Slave
Address
1

Chengdu Ebyte Electronic Technology Co.,Ltd. ME31-AAAX2240_UserManual_EN
Copyright ©2012–2023, Chengdu Ebyte Electronic Technology Co.,Ltd 13
3.3 Mechanical Dimensional Drawing

Chengdu Ebyte Electronic Technology Co.,Ltd. ME31-AAAX2240_UserManual_EN
Copyright ©2012–2023, Chengdu Ebyte Electronic Technology Co.,Ltd 14
3.4 Port and indicator light description
No.
Label
Illustrate
1
TX(LED)
Serial port send data indicator light
2
RX(LED)
Serial port receiving data indicator light
3
LINK(LED)
Network connection light
4
NET(LED)
Network data sending and receiving indicator light
5
PWR(LED)
Power input indicator
6
DO1(LED)
The first relay output indicator
7
DO2(LED)
The second relay output indicator
8
DO3(LED)
The third relay output indicator
9
DO4(LED)
The fourth relay output indicator
10
GND
Negative pole of power input terminal, DC 8V~28V, 5.08mm Phoenix terminal.
11
VCC
Positive pole of power input terminal, DC 8V~28V, 5.08mm Phoenix terminal.
12
NO1
Relay 1 normally open pin, used with relay 1 common terminal, 5.08mm
Phoenix terminal.
13
COM1
Common terminal of relay 1, used in conjunction with the normally open pin of
relay 1, 5.08mm Phoenix terminal.
14
NO2
Relay 2 normally open pin, used with relay 2 common terminal, 5.08mm

Chengdu Ebyte Electronic Technology Co.,Ltd. ME31-AAAX2240_UserManual_EN
Copyright ©2012–2023, Chengdu Ebyte Electronic Technology Co.,Ltd 15
Phoenix terminal.
15
COM2
Common terminal of relay 2, used in conjunction with the normally open pin of
relay 2, 5.08mm Phoenix terminal.
16
NO3
Relay 3 normally open pin, used with relay 3 common terminal, 5.08mm
Phoenix terminal.
17
COM3
Common terminal of relay 3, used in conjunction with the normally open pin of
relay 3, 5.08mm Phoenix terminal.
18
NO4
Relay 4 normally open pin, used with relay 4 common terminal, 5.08mm
Phoenix terminal.
19
COM4
Relay 4 common terminal, used with relay 4 normally open pin, 5.08mm
Phoenix terminal.
20
Ethernet
Ethernet interface, standard RJ45 interface.
21
AI2
Analog input channel 2, supports 0 to 20mA current input, 5.08mm Phoenix
terminal.
22
AI1
Analog input channel 1, supports 0 to 20mA current input, 5.08mm Phoenix
terminal.
23
DI2
Digital input channel 2, supports dry contact access, 5.08mm Phoenix terminal.
24
DI1
Digital input channel 1, supports dry contact access, 5.08mm Phoenix terminal.
25
GND
Signal ground, 5.08mm Phoenix terminal.
26
485-A
The A of the serial port is connected to the A interface of the external device,
and the 5.08mm Phoenix terminal.
27
485-B
The B of the serial port is connected to the B interface of the external device,
and the 5.08mm Phoenix terminal.

Chengdu Ebyte Electronic Technology Co.,Ltd. ME31-AAAX2240_UserManual_EN
Copyright ©2012–2023, Chengdu Ebyte Electronic Technology Co.,Ltd 16
IV. Product Function Introduction
4.1 DI Input
4.1.1. Switch Input DI Collection
The switch input DI measures level signals or edge pulse signals (rising edge, falling edge). Support dry
contact collection, support DI counting function, the maximum counting value is 65535 (the count exceeding 65535
is automatically cleared).
The switch input DI supports three trigger modes: rising edge, falling edge, and level (default rising edge
trigger).
The clearing method supports automatic clearing and manual clearing (default automatic clearing).
4.1.2. Input filtering
When the switch inputs DI to collect signals, it needs to maintain multiple sampling periods before confirming.
Filter parameters can be set in the range of 1 to 16 (default 6 sampling periods, 6*1kHz).
It can be configured with the host computer through instructions.
4.2 AI Input
4.2.1. Analog range
The analog input AI measures the current signal, the acquisition range is 0-20mA or 4-20mA, the precision is
3‰, and the resolution is 12 bits. The device adopts single-ended input, the sampling frequency is 10Hz, and the
input impedance is 100Ω.
Set the sampling range of all AI channels, valid values are 1 and 0 (default 0).
Configured as 0: means 0~20mA
Configured as 1: means 4~20mA
[Note] AI configuration instructions
(1)The AI sampling range of each channel can be set. When the AI channel sampling range is configured as
4~20mA sampling, if the current signal is lower than 3.5mA, it will be displayed as 0, and if it is higher than 3.5
mA and lower than 4mA, it will be displayed as 4. There is no conversion limit for signals greater than 20mA, but it
cannot exceed 25mA (there is a risk of equipment damage if it exceeds 25mA).
(2)The starting address of the AI channel sampling range parameter is 0x04B2, the register type is a
holding register, and the function codes are 0x06 and 0x10. When writing AI channel sampling range parameters, if
the written parameter value is not within the range of 0 to 1, it will automatically take the closest value and write it
in. If the sampling range parameter is 2, the device will take 1 as the sampling range parameter. And Modbus does
not return error commands.

Chengdu Ebyte Electronic Technology Co.,Ltd. ME31-AAAX2240_UserManual_EN
Copyright ©2012–2023, Chengdu Ebyte Electronic Technology Co.,Ltd 17
4.2.2. Trigger mode
(1)Not trigger: mode off.
(2)Rising trigger: When the AI input value becomes greater than the set AI trigger high value, the AI trigger
is high (that is, the output state is 1), and a rising edge trigger is generated. After triggering, as long as the AI value
is not lower than the set AI trigger low value, the current output value is always 1 (can be matched with DO
linkage).
(3)Falling trigger: When the AI input value becomes less than the set AI trigger low value, the AI trigger is
low (that is, the output state is 0), and a falling edge trigger is generated. After triggering, as long as the AI value is
not higher than the set AI trigger high value, the current output value is always 0 (can be matched with DO
linkage).
(4)Bilateral trigger: When the AI input value becomes greater than the set AI trigger high value, the AI
trigger is high (that is, the output state is 1), and a rising edge trigger is generated. After triggering, as long as the AI
value is not lower than the set AI trigger low value, the current output value is always 1; when the AI input value
becomes smaller than the set AI trigger low value, the AI trigger is low (that is, the output state is 0) , generating a
falling edge trigger. After triggering, as long as the AI value is not higher than the set AI trigger high value, the
current output value is always 0 (can be matched with DO linkage).
4.2.3. Engineering quantity shaping value and engineering quantity floating point value of
analog input
There are two ways to read the current signal collected by the device:
(1)Read the AI engineering quantity shaping value, and directly convert to get the input current. The
starting address of the AI engineering quantity shaping value register is 0x0064, the register type is an input register,
and the read function code is 0x04. The value returned by this method represents one channel per register, and the
value read is 0 to 25000. The method of calculating the current size is 0~25000 corresponding to 0~25mA. That is:
Current = engineering value / 1000 (mA)
(2)Read the floating-point value of the AI engineering quantity, and use the IEE754 conversion tool to
convert the hexadecimal data into a floating-point number to obtain the input current. The starting address of the AI
engineering quantity shaping value register is 0x00C8, the register type is an input register, and the read function
code is 0x04. This method returns two registers representing 1 channel.
4.2.4. AI filter parameters
You can set the filter parameters of the AI channel, the effective value is 1-16, and the default value is 6.
Description of filter parameters:
(1)All AI channels share a filter parameter. The higher the parameter value, the more stable the output value and
the slower the response.
(2)The AI channel filter parameter address is 0x04B0, and the register type is a holding register. Function code
0x06, 0x10.
(3)When writing AI filter parameters, if the written parameter value is not within the range of 1 to 16, it will

Chengdu Ebyte Electronic Technology Co.,Ltd. ME31-AAAX2240_UserManual_EN
Copyright ©2012–2023, Chengdu Ebyte Electronic Technology Co.,Ltd 18
automatically take the closest value and write it in. If the filter parameter is written as 0, the device will take 1 as
the filter parameter, and Modbus does not return error commands.
4.3 DO output
Relay output mode: output different mode output according to the mode set by the user, and the level output is
turned on by default.
4.3.1. Input count
Support counting DI input, users can configure rising edge acquisition, falling edge acquisition, and level
acquisition according to their own needs. You can also change the clearing method according to your needs.
Trigger method:
Rising edge: When the rising edge is collected (it is not counted when it is turned on, it is counted when it is
turned off), it will be counted once.
Falling edge: When the falling edge is collected (counting when it is turned on, and not counting when it is
released), count once.
Level: Two edges are collected and counted once respectively.
Clearing method:
Automatic: The device will automatically clear each time the DI count value register (0x09DF~0x09E6) is
read.
Manual: In manual mode, it is necessary to write 1 to the clear signal register (0x0AA7~0x0AAE), and each
holding register controls one clear signal.
4.3.2. Level output
Output according to the level set by the user, the switch characteristic of the level mode is similar to the
function of a self-locking switch.
4.3.3. Pulse output
After the switch output DO is turned on, the switch output DO is automatically turned off after maintaining the
set pulse width time (in ms). The pulse width setting range is 50~65535ms (50ms by default).
4.3.4. Follow mode
According to the follow source configured by the user (when the device has AI acquisition or DI detection
function, both DI or AI can be used as the follow source, otherwise this function is useless) to change the relay state,
and multiple outputs can follow the same follow source output. To put it simply, DI detects the input, and
automatically outputs a relay that uses it as a follow source (for example: DI is 1, DO is closed). When the follow
mode is turned on, the follow source should be configured at the same time, otherwise it will follow the first input
by default.

Chengdu Ebyte Electronic Technology Co.,Ltd. ME31-AAAX2240_UserManual_EN
Copyright ©2012–2023, Chengdu Ebyte Electronic Technology Co.,Ltd 19
4.3.5. Reverse follow mode
According to the follow source configured by the user (when the device has AI acquisition or DI detection
function, both DI or AI can be used as the follow source, otherwise this function is useless) to change the relay state,
and multiple outputs can follow the same follow source output. To put it simply, DI detects the input, and
automatically outputs the relay that follows it as the source (for example: DI is 1, DO is disconnected). When the
follow mode is turned on, the follow source should be configured at the same time, otherwise it will follow the first
input by default.
4.3.6. Trigger toggle mode
According to the follow source configured by the user (when the device has AI acquisition or DI detection
function, both DI or AI can be used as the follow source, otherwise this function is useless) to change the relay state,
and multiple outputs can follow the same follow source output. Simply put, when DI generates a trigger signal
(rising edge or falling edge), DO will have a state change. When the trigger flip mode is turned on, the following
source should be configured at the same time, otherwise it will follow the first input by default.
4.3.7. Power-on state
According to the state set by the user. After the device is powered on, the output relay is turned on according
to the state set by the user, and it is turned off by default.
4.4 Modbus Gateway
The device can transparently transmit non-native Modbus commands from the network/serial port to the serial
port/network, and the local Modbus commands are directly executed.
4.4.1. Modbus TCP/RTU protocol conversion
After it is turned on, the Modbus TCP data on the network side will be converted to Modbus RTU data.
4.4.2. Modbus Address Filtering
This function can be used when some host software or configuration screen is used as the host to access the
serial port of the device, and the gateway function of the device is used, the slave is at the network end, and the
Modbus TCP to RTU function is turned on. Multiple slaves on the bus may cause data confusion. At this time,
enabling address filtering can ensure that only the specified address can pass through the device; when the
parameter is 0, the data will be transparently transmitted; when the parameter is 1-255, only the set slave machine
address data.
Other manuals for ME31-AAAX2240
1
Table of contents
Other Ebyte I/O System manuals