Modbus To Ethernet
Modbus To Ethernet
BL124
User Manual
Modbus to Ethernet/IP Gateway
-BL124
Version: V1.0
Date:2024-05-22
Website: https://www.bliiot.com
Preface
Thanks for choosing BLIIoT BL124 Gateway. Reading this manual with full attention
will help you quickly learn device functions and operation methods.
Copyright
This user manual is owned by Shenzhen Beilai Technology Co., Ltd. No one is
authorized to copy, distribute or forward any part of this document without written
approval of Beilai Technology. Any violation will be subject to legal liability.
Disclaimer
This document is designed for assisting user to better understand the device. As the
described device is under continuous improvement, this manual may be updated or
revised from time to time without prior notice. This Protocol Gateway is mainly used
for industrial data transmission over Ethernet. Please follow the instructions in the
manual. Any damages caused by wrong operation will be beyond warranty.
Revision History
Content
1 Product Introduction .............................................................................................. 5
Overview ........................................................................................................ 5
Features ......................................................................................................... 6
LED Indicator.................................................................................................. 9
Reset ............................................................................................................ 10
Mounting ....................................................................................................... 10
3 Operation ............................................................................................................ 10
Power On ..................................................................................................... 10
Overview ...................................................................................................... 28
1 Product Introduction
Overview
Packing List
Before connecting the gateway, please make sure below items are included in the
package:
(Pictures are for reference only.)
⚫ 1 X Gateway with terminal Blocks
Note: If any of above items are missing, please contact BLIIOT Sales team.
Features
➢ 2CH RS485
Technical Parameter
Parameter Description
Power Input Voltage DC 9~36V
Supply Power Consumption Normal: 50mA@12V, Max: 20mA@36V
Specification 2 x RJ45, 2x10/100Mbps
Ethernet
ESD: ±6kV(Contact), ±8kV(Air)
Port Protection
EFT: 1kV, 5kHz
QTY 2CH RS485
2400, 4800, 9600, 19200, 38400, 57600,
Baud Rate
115200
Data Bit 8
Parity Bit None, Even, Odd
Serial Port Stop Bit 1, 2
Mode RTU Master/Slave
Function 01H, 02H, 03H, 04H, 05H, 06H, 0FH, 10H
Connection Up to 31 connections to a single serial port
ESD ±6kV(Contact), ±8kV(Air)
Protection
EFT ±1kV, 5kHz
PWR Always on when device powered on
RUN Flickering when system running
Indicator
LINK Flickering when TCP communicating
RS485 Flickering when communicating
Protocol Ethernet/IP, Modbus RTU
Default bytes "2Bytes"
Max input/output
Software Max Input Bytes ≤496Bytes
data volume
Max Output Bytes ≤496Bytes
File EDS
Safety EMC IEC 61000-4-2 (ESD) Level 3
2 Hardware Introduction
Outline Dimension
LED Indicator
Reset
After the gateway operates normally, press and hold the Reset button continuously
for about 10 seconds until link indicator light remains on, at which time the gateway
restores the factory default settings if it restarts automatically.
Mounting
3 Operation
Power On
The device is powered by a 9-36V DC voltage, and the power indicator LED (PWR)
The "RUN" status indicator light is initially off after powering up. After waiting for 1 to
2 minutes, the RUN indicator light will start blinking slowly, indicating that the device
is starting up and operating normally. If the light remains off continuously, it indicates
a device failure.
COM Port
The device features two RS485 serial ports, which can be used for Modbus RTU
master, Modbus RTU slave.
Modbus Master Function: This gateway will operate as a Modbus master. The serial
port will be connected to Modbus slave devices. By configuring slave parameters
through the configuration page, the gateway will collect data from the slaves using
the Modbus protocol, thereby achieving the conversion from the Modbus protocol to
the Ethernet/IP protocol.
When the Modbus master settings select the slave interface as RS485, RS232, or
Ethernet, the gateway will continuously and actively poll the slave devices according
to the Modbus RTU protocol (for RS485 interfaces) or the Modbus TCP protocol (for
Ethernet interface). The read and write operations will be transmitted directly to the
Users can connect various slave devices through the RS485 serial port or Ethernet
port to expand I/O ports and to read and write intelligent instruments and devices.
For example, users can connect to our Mxxx series remote I/O modules to expand
the number of DI, DO, AI, AO, and PT100 input ports, connect to power parameter
monitoring modules to read the current, voltage, and power of three-phase electricity,
or connect to a UPS power supply for parameter monitoring. Additionally,
combinations of these intelligent devices can be used to meet the functional
requirements of most application scenarios.
Modbus Slave Function: This gateway will operate as a Modbus slave. The serial
port will connect to Modbus master devices. By configuring serial port parameters
and server parameters through the configuration page, the master device can collect
this device's I/O data using the Modbus RTU protocol (via RS485 interfaces) or the
Modbus TCP protocol (via Ethernet interface).
This device will convert the Modbus protocol to the Ethernet/IP protocol in the form of
a Modbus RTU master or slave.
The device supports web configuration using a wired connection. To configure the
device, connect your computer to the configuration port using an Ethernet cable.
Open a web browser on your computer and enter the default login address for the
device, which is 192.168.3.10. The default login username is "admin" with no
password required.
Wired connection
Manually assign a static IP address to the PC within the same subnet as the router's
address, clicking and configuring "Use the following IP address."
Item Description
Login IP address 192.168.3.10
Username admin
Password No password
1, Connect to the router either via wired or wireless connection on your PC. Then,
open a web browser such as IE, Edge, Google Chrome, or another browser.
2, Enter the router's IP address 192.168.3.10 to access the login page.
3, Enter the username "admin" (default) and leave the password blank (default), then
click the "Login" button.
4, After successfully logging in to it, you will be directed to the status overview page.
5, After configuring the parameters, make sure to click on "Save and Apply" on the
interface to apply the settings.
"Logout".
4.4.1 Status
In the status menu, options include Overview, System Log, and Kernel Log, allowing
users to view device parameters and operational status.
Status > Overview
4.4.2 System
4.4.2.1 System
Description Default
Display the current device time. You can click on
Local Time "Sync with Browser" or "Sync with NTP Server" --
button to update the device time.
You can customize the device name for easier
Hostname BL124
differentiation between multiple devices.
Timezone You can select the time zone UTC
Description Default
System log buffer size Default 64 64
Enter the IP address of the server
External system log server
where the location is saved.
External system server port Server port
External system log server protocol UDP or TCP UDP
Write system log to file /tmp/system.log
Log output level Select the log level for saving the logs. Debug
Cron Log Level Debug
Description Default
Language Auto, English, Chinese Auto
Design Bootstrap Bootstrap
4.4.2.2 Administration
4.4.2.3 Backup/Flash
Description Default
Click "Generate archive" to download the
Backup --
current configuration file as a tar archive.
Upload the backup archive to restore the
configuration. To reset the firmware to its initial
Restore --
state, click "Perform Reset" (only valid for
squashfs format firmware).
4.4.3 Settings
Description Default
Choose between "static address" and
IP Address Type Static IP
"dynamic address".
Set device IP Address Device Ethernet/IP Address
Subnet Mask 255.255.255.0
On the same network segment as the
Gateway Address
device IP
Description Default
COM Type RS485
COM Name RS485A, RS485B
Baudrate 2400-115200 9600
Data bits 7 or 8 8
Parity None, Odd, Even None
Stop bits 1 or 2 1
Modbus Settings Check chapter 4.4.4.2
By default, input and output are "2 bytes" without configuration. For the convenience
of calculation, it is best to calculate the function codes 01/02/05/06 in 2-byte
As an example, add 8 bytes each of input and output, and calculate the number of
T>>O, O>>T bytes
When adding an odd number of bytes, the number of bytes should be increased by 1;
as shown in the figure below, adding inputs as 0-8 is 9 bytes, so plus 1, actually filled
in 10 bytes.
Overview
The gateway reads and writes data from the Ethernet/IP side and the Modbus side,
storing the data in their respective buffers. The gateway then exchanges the buffer
data internally, thereby enabling data transmission between the two sides.
MODBUS involves controllers (or MODBUS devices) with storage areas identified by
0xxxx, 1xxxx, 3xxxx, 4xxxx:
Storage Area
Name Type Write/Read Storage Unit Address
Identifier
0xxxx Coil Bit Read/Write 00000~0xxxx
1xxxx Input Coil Bit Read-only 10000~1xxxx
3xxxx Input Register Word Read-only 30000~3xxxx
4xxxx Holding/Output Word Read/Write 40000~4xxxx
Register
Address Function High Byte of Low Byte of High Byte Low Byte CRC
Code Starting Starting of Coil of Coil
Address Address Count Count
13H 01H 00H 11H(17) 00H 25H XXXX
Function: Read the status of output coil 0xxxx from the slave.
In this example: Read output coils from slave 13H, starting at coil address 001H
(which is 17 in decimal), with a count of 0025H (which is 37 in decimal). Therefore,
the query message functionality is to read output coils from slave 19 (13H in
hexadecimal), addressing coils 00017 to 00053, totaling 37 coils.
00049
0
00053
Address Function High Byte of Low Byte of High Byte Low Byte CRC
Code Starting Starting of Coil of Coil
Address Address Count Count
Function: Read the status of output coils 1xxxx from the slave.
In this example: Reading output coils from slave 13H, starting at coil address 0012H
(which is 18 in decimal), with a count of 0010H (which is 16 in decimal). Therefore,
the query message function is to read output coils from slave 19 (13H in
hexadecimal), addressing coils 10018 to 10033, totaling 16 coils.
Address Function High Byte of Low Byte of High Byte Low Byte CRC
Code Starting Starting of of
Address Address Register Register
Function: Read the status of output coils 4xxxx from the slave.
In this example: Reading output coils from slave 13H, starting at register address
0060H (which is 96 in decimal), with a count of 0002H (which is 2 in decimal).
Therefore, the query message function is to read values of 3 holding registers 40096-
40097 from slave 19 (13H in hexadecimal).
Address Function Byte High Byte Low Byte High Byte Low Byte CRC
Code Count of of of of
Register Register Register Register
40096 40096 40097 40097
Function: Slave returns the values of holding registers: 40096 = 0300H, 40097 =
022AH.
Address Function High Byte of Low Byte of High Byte Low Byte CRC
Code Starting Starting of of Register
Address Address Register
Function: Read the status of output coils 3xxxx from the slave.
In this example: Reading output coils from slave 13H, starting at register address
0005H (which is 5 in decimal), with a count of 0001H (which is 1 in decimal).
Therefore, the query message function is to read the value of 1 holding register
30005 from slave 19 (13H in hexadecimal).
Function: Slave returns the value of input register 30005: 30005 = 0000H
Address Function High Byte of Low Byte of High Byte Low Byte CRC
Code Starting Starting of of
Address Address Register Register
Function: Force the status of output coils 0xxxx for slave 19.
In this example: Starting address = 0011H (which is 17 in decimal), force set coil
0017 of slave 19 to ON state.
Address Function High Byte of Low Byte of High Byte Low Byte CRC
Code Register Register of of
Register Register
In this example: Pre-set single holding register 40021 of slave 19 to the value
0x0101.
Address Function High Byte of Low Byte of High Byte of Low Byte of CRC
Code Register Register Register Register
Function: Pre-set holding register 40021 of slave 19 to the value 0x0101 and then
return the original message.
Addre Function High Low High Low Byte Coil Coil CRC
ss Code Byte of Byte of Byte Byte Coun Statu Statu
Coil Coil of of t s s
Addres Addres Coil Coil
s s Coun Coun
t t
13H 0FH 00H 11H 00H 09H 02H 01H 01H XXX
X
In this example: Pre-set multiple consecutive coils for slave 19. Starting coil address
is 0011H (which is 17 in decimal), with a count of 0009H (which is 9 in decimal).
Therefore, the query message function is to force 9 coils, addresses 00017 to 00025,
of slave 19.
Address Function High Byte Low Byte of High Byte of Low Byte of CRC
Code of Coil Coil Coil Count Coil Count
Address Address
Function: Pre-set values for multiple holding registers 4xxxx of the slave.
In this example: Pre-set values for multiple holding registers of slave 19. Starting
register address is 000AH (which is 10 in decimal), with a count of 0002H (which is 2
in decimal). Therefore, the query message function is to force the values of 2 holding
registers of slave 19.
⚫ Providing the gateway with 24VDC system power and on-site power, using an
Ethernet cable to connect from the ETHERNET/IP interface to the PC.
⚫ Open a web browser, enter the gateway device's IP address to access the
configuration interface. (Ensure the computer is on the same network segment
as the gateway.)
⚫ Access the configuration interface for the master station, and write the
corresponding parameters into the configuration.
⚫ Open CODESYS software. Create a new project, and in the popup window,
select "CODESYS Control Win V3 x64 (3S-Smart Software Solution GmbH)".
Click OK to proceed.
Click on the icon in the bottom right corner of the computer. “CODESYS
Double-click on "Devices", then click on "Scan Network" on the right-hand side. The
software will automatically scan the laptop (computer name). Double-click on the
computer name to access the communication settings interface. The laptop's
communication status will display green, indicating normal communication. It will be
online, allowing for downloading and monitoring of data. (You can find the computer
name in Settings -> System -> About.)
Select "Ethernet", right-click to add a device, then choose "EthernetIP" -> "EthernetIP
Scanner" -> "EthernetIP Scanner", and click "Add Device".
Double-click on "Ethernet", then click on "General" on the right side. Select the
local network card and click "OK".
Right-click on "Ethernet/IP Scanner" and click "Scan Modules". In the popup window,
it will display "Unable to scan devices: stack not available, please login first".
Close the window, select "PLC Device", and click "Compile". If there are no
errors during compilation, click "Login to" Click "Yes", then click "Start".
In the popup window, it shows that the device is not located in the device library.
Click on "Tools" - "Device Repository" (This allows you to install the EDS files for the
Ethernet/IP gateway when opening CODESYS software).
In the popup window, click "Install", select the EDS file for the gateway, click "Open",
and successfully install the gateway's EDS file.
Right-click on "Ethernet/IP Scanner" and click "Scan Modules". Copy the scanned
gateway information into the project.
To logout from the PLC, double-click on the module information to view all input and
output data.
Select "PLC Device", click on "Compile", then "Login", and finally "Online".
Communication is normal, with default input and output both set to "2 bytes".
Configuring BL124 gateway with 2-byte input and output in the 192.168.1.xx network
segment.
Preparation: Module assembly, wiring referencing product installation guide, and
device connection operations.
Open Sysmac Studio software, click on "New Project", select NX1P2-9024DT,
and click "Create".
Click on "Configuration and Setup" -> "Controller Setup" -> "Built-in EtherNet/IP
Port Settings" to modify the IP address.
Set your computer's IP address to be in the same network segment as the PLC.
The PLC address is 192.168.1.21.
View the size of the input and output data areas for Ethernet/IP communication,
both T-->O and O-->T byte sizes, can be checked through web configuration or
calculated. Refer to “Serial Settings”.
T-->O size is 2 bytes and O-->T size is 2 bytes for Ethernet/IP communication, as
obtained from web configuration.
Click on "Registered All". In the popup window, select the input variable input and
the output variable output defined in the global variables, then click on
"Register".
In the right-side toolbox, right-click and select "Display EDS Library". If it's your
first time using it, you'll need to install the EDS file for BL124.
After installation, in the toolbox pane, click on "+" to add the BL124 gateway. In
the "Model Name" dropdown, select "BL124", choose version "2", and enter the
specific gateway address as required.
Click on the connect icon, then click "+" to add a new connection. Choose
"192.168.1.123 BL124" as the target device. Under "Originator Variable", select
the variable "input" for input and "output" for output. In the "Target Variable"
section, enter "100" for input and "150" for output, ensuring the target byte size
matches the start variable byte size.
Click on "Controller" -> "Online", or click on the shortcut icon Click on the
menu bar: "Controller" -> "Transfer" -> "Transfer to Controller". In the popup
window, click "Execute" to download the configuration, settings, and program to
the PLC. In the popup window, click "Yes" -> "Yes" -> "OK" in sequence. For
Ethernet/IP configuration, also click "Transfer to Controller" to download the
configuration to the PLC.
Click on "View" -> "Watch Tab Page". In the watch window, add input and output
variables to monitor data. You can monitor all data like input[0..1], or individually
monitor data from a specific module such as input[0]. These names correspond
to variables created as global variables.
Configuring the BL124 gateway with 2-byte input and output in the 192.168.1.xx
network segment.
Click on the shortcut "Configure drivers." , Configure the driver in the pop-up
dialog box.
After completing the driver configuration, devices on the EtherNet/IP network are
listed in the left navigation area of the interface.
To run Studio 5000 software, select "New Project" to create a new project. Choose
the PLC model as the device name, name your project, and then click the "Next".
Select the version number, then click the "Finish" button to complete the process.
1. In the left navigation pane of the tools, select the "Ethernet" node.
2. Right-click on it and choose "New Module..." from the pop-up menu.
In the pop-up dialog box, locate the model of the gateway device, then click the
"Create" button.
In the left navigation pane, select the "Controller" node. Open the tabbed interface to
view input and output data.
6 Warranty Term
1) This equipment will be repaired free of charge for any material or quality problems
within one year from the date of purchase.
2) This one-year warranty does not cover any product failure caused by man-made
damage, improper operation, etc.
7 Technical Support