ZLAN 5143D User manual

1
ZLAN5143D DIN-type
Serial Device
Server/Modbus
Gateway
User Manual
RS485 to TCP MQTT JSON Modbus
TCP Converter
CopyRight©2008 Shanghai ZLAN Information Technology Co., Ltd. All right
reserved
Document DI: ZL DUI 20181025.1.0

2
CopyRight©2008 Shanghai ZLAN Information Technology Co., Ltd. All right reserved
Version Information
The History of the revision to this document:
History
Date
Version
Document ID
Revising content
2019-10-25
Rev.1
ZL DUI 20181025.1.0
Release
Copyright information
Information in this document is subject to change without notice. It is against the law to
copy the document on any medium except as specifically allowed in the license or
nondisclosure agreement. The purchaser may make one copy of the document for backup
purposes. No part of this manual may be reproduced or transmitted in any form or by any
means, electronic or mechanical, including photocopying, recording, or through
information storage and retrieval systems, for any purpose other than for the purchaser’s
personal use, without the express written permission of Shanghai ZLAN information
Technology Co., Ltd.

3
Contents
1. Summary...................................................................................................................................5
2. Features.................................................................................................................................... 8
2.1 Hardware characteristics.........................................................................................8
2.2 Software functions.................................................................................................... 8
2.3 Advanced software features...................................................................................9
3. Technical Parameters......................................................................................................... 10
4. Instructions............................................................................................................................10
5.1 Hardware.................................................................................................................... 10
5.2 Hardware Connection............................................................................................. 14
5.3 Software Installation............................................................................................... 14
5.4 Parameter Configuration....................................................................................... 15
5.5 TCP communication test....................................................................................... 21
5.6 Virtual serial port test............................................................................................. 22
5.7 Modbus TCP test......................................................................................................25
5.8 Web Configuration...................................................................................................26
5. Work Mode and Transfer Protocol.................................................................................. 28
5.1 Virtual Serial Mode.................................................................................................. 29
5.2 Direct TCP/IP Communication Mode..................................................................29
5.1.1 TCP Client Mode...........................................................................................30
5.1.2 The Client connects to Multiple Servers............................................... 31
5.1.3 TCP Server Mode......................................................................................... 33
5.1.4 Be both Client and Server......................................................................... 33
5.1.5 UDP Mode.......................................................................................................34
5.3 Device Pairs-connect Mode.................................................................................. 35
6. Device Debugging................................................................................................................37
6.1 Network Physical Connection.............................................................................. 37
6.2 Network TCP Connection...................................................................................... 37
6.3 Data Sending and Receiving................................................................................ 38
6.4 ZLVircom Remotely Monitor Data....................................................................... 39
7. Modbus Advanced Features............................................................................................. 40
7.1 Enable Modbus Gateway....................................................................................... 40
7.2 Storage Modbus Gateway..................................................................................... 41
7.3 Disable Storage Functionality.............................................................................. 44
7.4 Multi-host Function................................................................................................. 45
7.5 Multi-host Parameter...............................................................................................46
7.6 Modbus Under Multi-destination IP.................................................................... 48
8. Registration Pack and Heartbeat Pack.......................................................................... 48
8.1 Registration Packet................................................................................................. 48
8.1.1 Connect to send MAC Addresses........................................................... 49
8.1.2 Realcom Agreement....................................................................................49
8.1.3 Custom Registry.......................................................................................... 50
8.1.4 Transcode Configuration Files.................................................................51

4
1.1 The Heartbeat Packets........................................................................................... 52
8.2.1 Implied Heartbeat.........................................................................................52
8.2.2 REALCOM agreement.................................................................................53
8.2.3 Customize Heartbeat Packets.................................................................. 53
9. HTTPD Client Communication Function....................................................................... 53
10. Transcoding Functions.............................................................................................. 54
1.2 Enable the Transcoding......................................................................................... 55
1.3 Case of Transcoding Implementation................................................................ 56
1.4 Notice.......................................................................................................................... 57
11. Network Interface to Modify Parameters...............................................................58
12. Device Management Function Library................................................................... 59
13. Serial Port Modify Parameters................................................................................. 59
14. Remote device management.................................................................................... 60
15. Firmware upgrade method........................................................................................ 62
16. After-service.................................................................................................................. 66

Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com
5
1. Summary
ZLAN5143D is a kind of RS485 device data collector/IOT gateway specially designed
for industrial environment, which integrates serial port server, Modbus gateway, MQTT
gateway, RS485 to JSON and other functions. It has an RS485 interface and RJ45
interface. It uses guide-way type installation way, the volume is compact and
installation is convenient. Terminal type power supply access, 9~24V wide voltage
input. Because there is only RS485 interface, the RS232 interface which is not
commonly used on industrial instruments is cancelled, which saves the cost and
volume and has a higher cost performance ratio compared with ordinary products.
Figure 1 ZLAN5143D
When used as a normal serial port server, the 5143D network port is connected to the
RJ45 Ethernet. The host computer software can use TCP/UDP transmission mode or
virtual serial port mode to send data to the 5143D RS485 interface. Data received on
the RS485 interface is also transferred to software or virtual serial ports on the TCP

Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com
6
end. Under the mode of virtual serial port, the serial port software connected to virtual
serial port can be used without any configuration.
When used as Modbus gateway, 5143D supports Modbus TCP to Modbus RTU, so as
to realize data acquisition of RS485 Modbus RTU device by upper computer using
Modbus TCP protocol. On the contrary, it can be used if RS485 terminal as the master
station. 5143D supports more advanced Modbus gateway functions, including
configurable Modus gateway ZLMB, storage Modbus gateway, etc., which fully meets
all kinds of configuration and usage of Modbus gateway. The multi-host feature allows
multiple computer master stations to simultaneously access one RS485 slave device.
When used as MQTT gateway, the device can upload the serial port data to MQTT
server in the way of transparent transmission through MQTT protocol. Supported
servers include BAIDU cloud MQTT, ALI cloud MQTT, China mobile OneNet platform,
etc. It is supported to parse the collected Modbus RTU or non-standard serial port
data into JSON format and encapsulate it into MQTT packet for uploading.
It supports JSON format to upload and collect data, and the data is automatically
collected. The collected data supports Modbus RTU, 97 version of 645 meter, 07
version of 645 meter, and various non-standard RS485 protocols. The user can
configure the uploaded data format and JSON keywords with ZLVircom. When
uploading, MQTT protocol, HTTP POST protocol, HTTP GET protocol, transparent
transport protocol and various non-standard network protocols can be supported.
Among them, ZLAN5143DN model supports P2P networking, no need to relay
through the server, and connect the device through ID.
ZLAN5143D has powerful functions of IOT gateway, which is very suitable for
collecting all kinds of RS485 instruments and sensors in the industrial field, including
collection of local network or uploading to cloud server for independent collection and
posting.
ZLAN5143D can be applied to:
As the gateway of IoT and the communication bridge between devices and cloud;

Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com
7
Power, intelligent instrument and energy consumption monitoring;
All kinds of automation PLC remote monitoring and program download;
All kinds of configuration software and equipment communication interface;
Networking of access control and security equipment;
Typical application connections are shown in figure 2. The original serial port device
RS485 is connected to the RS485 port of ZLAN5143D, and the 5143D is connected to
the computer through the network cable. The software on the computer connects to
5143D via TCP/IP or virtual serial port. Thereafter, any data sent by the serial device
will be transmitted transparently to the computer's software, and the data sent by the
software to ZLAN5143D via the network will also be transmitted transparently to the
serial device.
Figure 2 Connection Diagram

Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com
8
2. Features
2.1 Hardware characteristics
ZLAN5143D has the following features:
1) Guide-way design: suitable for internal installation of cabinet in industrial field.
2) Compact size: relative to the ordinary serial port server, the width is small, does
not take up space.
3) Terminal type power supply, 9~24V wide voltage input, with anti-opposite power
connection protection.
4) Terminal RS485 interface, support 32 slave devices, baud rate support 300 ~
115200bps.
5) Abundant panel indicator light for debugging: in connection, not only indicates
whether the network cable is connected to the RJ45 interface light, but also
indicates the LINK light TCP connection established; Data indicator light has
"serial port to network port", "network port to serial port" independent indicator
light.
2.2 Software functions
1) Support TCP server, TCP client, UDP mode, UDP multicast. Support TCP server
side function as TCP client. Support 30 TCP connections as a TCP server and 7
destination IP as a TCP client.
2) The baud rate supports 1200~115200bps, data bits support 5~9 bits, and parity
can be None, Odd, Even, Mark, Space. CTS/RTS hardware flow control and
XON/XOFF soft flow control.
3) Support the function of sending MAC address when device connecting to
facilitate cloud management of devices.
4) Provide search, configure the device secondary development package DLL on
PC.
5) Support Web browser configuration, support DHCP dynamic access IP, DNS
protocol connect domain name server address.

Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com
9
6) Support remote search device, configure device parameter, device program
upgrade on cloud.
7) Support remote viewing of TCP connection status, serial port data sending and
receiving status of devices through software. Virtual serial port supports data
monitoring.
2.3 Advanced software features
The 4 number in 5143D indicates that advanced soft functions are supported,
including:
1) Support Modbus gateway function, support Modbus RTU to Modbus TCP. The
storage Modbus can be supported, and the equipment data can be collected
automatically and stored. Modbus gateway for non-storage mode is also
supported.
2) Support for multiple hosts: support Ethernet port allows multiple computers to
access the same serial port device at the same time in a question-answer query
mode.
3) Support for MQTT gateway functionality.
4) Support JSON to Modbus RTU and 645 meter protocol, support HTTP POST,
HTTP GET format upload data.
5) Support for NTP protocol to obtain network time for serial output for protocol
content.
6) Support for custom heartbeat package and registration package features: easy to
communicate with the cloud and device identification.
7) Support TCP to establish a connection requires password authentication function,
to ensure the security of the connection.
8) Support "transcoding" function, can achieve specific device protocol translation
work, so that different devices docking unified software platform.
9) Support HTTP data submission and delivery functions, the cloud can directly use
HTTP GET instructions and device serial data for interaction.

Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com
10
3. Technical Parameters
Figure
Interface:
485: Terminal
Power Supply:
terminal
Size:
L x W x H =8.7cm×3.6cm×5.9cm
Communicate Interface
Ethernet:
RJ45 interface, 2KV surge protection
Serial
RS485×1: RXD, TXD, GND
Serial Parameters
Baud rate:
1200~115200bps
Parity:
None, odd check,
even check, mark,
space
Data bits:
5~9
Flow control:
None
Software
protocol:
ETHERNET, IP, TCP, UDP, HTTP, ARP, ICMP, DHCP, DNS
Setting method :
ZLVirCom, WEB browser, device management library
Net communication
method:
TCP/IP direct communicate, Virtual serial
Work Mode
TCP server, TCP client, UDP, Real Com Driver
Power Requirement
9~24V DC
Environment
Running temperature:
-40~85℃
Storage temp:
-45~165℃
Humidity:
5~95%RH
4. Instructions
4.1 Hardware

Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com
11
Figure 3
The elevation of the ZLAN5143D serial port server is shown in the figure above,
with a 35mm standard guide rail housing.
1) Power input: terminal: 5.08mm terminal. The input voltage is 9 ~ 24V.
Indicator
Power Supply
PGND
RJ45 port
NC

Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com
12
Figure 4 power supply and network port
2) RS485: use RS485 to connect 485B and 485A, where 485B represents the
negative line of 485 and 485A represents the positive line of 485; 485 with
load of 32. The longest communication distance is 1200 meters. Generally
RS485 line more than 300 meters when it is necessary to use the terminal
resistance, 485 terminal resistance is 120 ohms.
3) Network port: connect RJ45 interface network cable, support automatic
crossover.
4) Indicator lights: Power (PWR), Link (LNK) and Active (ACT) lights, which
respectively represent Power supply, connection indication and data
indication.
Table 2 meaning of indicator light
Power
Indicator
Power
Link
Indicator
1) Link is Green when the cable is connected.
2) When a TCP connection is established (or in UDP mode), the Link is
blue (actually with a faint green light). Can be used to determine

Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com
13
whether the serial server and the upper computer software to establish
a communication link.
Active
Indicator
1) The indicator light is green when the network port sends data to the
serial port. The flashing time is 1 second longer than the actual
communication time, making it easier to find short data communication.
2) When the serial port sends data to the network port, the indicator light is
both blue and green. Since blue is brighter, seeing blue indicates that
there is a serial port returning data to the network port. This can
determine whether the device has a response to the command of the
upper computer, if there is no corresponding indicates that the serial
port baud rate is wrong or the serial port is not connected well.
Use indicator light to debug communication method:
1) If the Link light is not green, the network cable is not well connected. Please
check the network cable.
2) If the Link lamp is not blue (only consider the TCP operating mode), then the
upper computer software does not establish a connection with the serial port
server. Please consider whether the IP address is configured in the same
network segment.
3) If the Active light is green, data is sent from a network port but not returned
from a serial device. Please check whether the baud rate is configured well
and whether the RS485 plus or minus is reversed.
4) Installation method: the equipment shell is equipped with 35mm standard
guide rail. When there is a guide rail, the equipment can be directly installed
into the guide rail.

Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com
14
Figure 5 back of the device
4.2 Hardware Connection
Generally speaking, serial port server only needs to connect power supply, serial
port and network cable.
The power supply can be configured with a 12V power adapter or a 2-wire power
supply on site, which can be directly connected to the positive and negative
terminals of the power supply.
RS485 device 485 is connected to TA, 485 is connected to TB.
The network port is connected to the ordinary network cable, which can be directly
connected to the computer or connected to the network through the switch.
4.3 Software Installation
ZLVircom can be used to configure the device IP and other parameters, also can
create virtual serial port. If no need the virtual serial port function, you can
download the free-installation version.
Table 3 ZLVircom Version
Software
Description

Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com
15
ZLVircom Device Management Tool
(free-installation version)
This version no have the virtual serial
port function
ZLVircom Device Management Tool
(installation version)
This version has the ZLVircom_x64.msi
and ZLVircom_x86.msi. The 64 bit
operating system install x64, 32 bit
system install x86 version.
Just follow the default prompt when installing. Upon completion of the installation,
ZLVircom will be started each time the computer is started, which is used to boot
up to create a virtual serial port.
4.4 Parameter Configuration
After installing ZLVircom, the hardware also connecting, run ZLVircom software as
figure, and click "Device Manage" as figure 6. Use ZLVircom can search and
configure the device parameter in different segment, which is very convenient as
long as the device and computer of running ZLVircom are under the same switch.

Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com
16
Figure 6 ZLVircom Main Interface
Figure 7 Device List
From the device list, you can see all of the current online devices, and you can
search for devices that are not in one network segment. There is no need to use
the "Add Manually" function.
Click the “Edit Device” to configure the device parameters.
Figure 8 Device Parameters

Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com
17
In this interface, the user can set the parameters of the device, then click "Modify
Setting", and the parameters are set to the flash of the device, with power-off no
lost. The device will restart automatically.
The main configuration parameters are: baud rate, data bit, and check bit in serial
port setting; IP address, subnet mask, gateway in network setting; Sometimes you
need to configure the work mode of the serial port server according to the
computer software.
The meaning of the parameters is described as follows:
Table 4 Parameter Meaning
Parameter
Name
Value Range
Instruction
Virtual Serial
Non-in use, created
virtual serial port
You can bind the current device to a created virtual serial
port.
Dev Type
Show only the model of the core module
Dev Name
Any
You can give the device a readable name, with a maximum
of 9 bytes, and support the Chinese name.
Dev ID
The factory's sole ID, cannot be modified.
Firmware
Version
The firmware version of core module
Supporting
Function
Please refer to the Table 4 “support functions”
IP Mode
Static, DHCP
The user can choose Static or DHCP (Dynamic acquisition
of IP)
IP Address
The IP Address of networking products
Port
0~65535
The monitoring port of Networking products when in the TCP
Server or UDP mode. As a client, it is best to specify that the
port is port 0, which is good for increasing the connection
speed, and the system will randomly assign a local port
when using the 0 port. At this time the difference from
specifying the non-zero port are: (1) local port is 0, module
sets up a new TCP connection with PC when restarting, old
TCP connection may not be closed, so that the old TCP
connection of the host has been unable to close, specify the
non-zero port does not have the problem. Generally host

Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com
18
wants to close the old connection when the module is
restarted. (2) the local port is 0, the time of TCP rebuilding
connection is faster.
Work Mode
TCP Server(TCP Server
Mode),TCP Client(TCP
Client Mode),UDP
Mode, UDP Multicast
When set to TCP Server, the network Server needs to
actively connect the networking products; When set to TCP
Client, the networking product initiates the connection to the
network server specified by the destination IP.
Net Mask
Eg: 255.255.255.0
Must be same as net mask of local LAN.
Gateway
Eg: 192.168.1.1
Must be the same as the local LAN gateway. If it is not
crossing outer network (such as the cable connecting
computer), it is best to set the gateway as the IP address of
the connected computer.
Dest.
IP/Domain
In the TCP Client or UDP mode, the data will be sent to the
destination IP or the computer of domain name instruction.
Dest. Port
In the TCP Client or UDP mode, the data is sent to the
destination port of the destination IP.
Baud Rate
1200, 2400, 4800, 7200,
9600, 14400, 19200,
28800, 38400, 57600,
76800, 115200, 230400,
460800
Serial baud rate
Data Bits
5, 6, 7, 8, 9
Parity
None, Even, Odd, Mark,
Space
Stop Bits
1, 2
Flow Control
None (no flow control),
CTS/RTS, DTR/DCR,
XON/XOFF
RS232 port valid
DNS Server
IP
When the destination computer is described by a domain
name, DNS server is required to resolve the domain name,
which specifies the IP of this DNS server. When the IP mode
is DHCP, the parameter is not specified and will be
automatically acquired.
Dest. Mode
Static, Dynamic
UDP working mode: if the destination computer is described
by a domain name, it’s best to choose the static mode; If
there are multiple computers in the LAN communicating with
networking products through UDP, it is best to choose
dynamic mode.
TCP server mode: this parameter must be dynamic.

Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com
19
TCP client mode: when IP mode is dynamic, the destination
IP is reconnected after the device is restarted, so that the
correct IP address can be obtained again. Otherwise, it will
do direct connection without automatically restarting the
device.
Transfer
Protocol
NONE, Modbus
TCP<->RTU,
Real_COM
NONE indicates that the data forwarding from the serial port
to the network is transparent; Modbus TCP<->RTU will
convert Modbus TCP protocol directly into RTU protocol to
facilitate coordination with Modbus TCP protocol; RealCOM
is designed to be compatible with the old version of
REAL_COM.
Keep Active
Time
0~255
(1) Choose 1~255, if the device is in the TCP client working
mode, the TCP heartbeat will be sent automatically for
every "keep alive time". This can guarantee the TCP
availability of links. When set to 0, there will be no TCP
heartbeat.
(2) Set to 0~254, when transformation protocol choose
REAL_COM protocol, the device will send a length of 0
to 1 content data for every " keep alive time " to
implement the heartbeat mechanism of Realcom. When
set to 255, there will be no Realcom heartbeat.
(3) Set to 0~254, if the device is working on the TCP client,
the device will send the parameters to the destination
computer every " keep alive time ". When set to 255, no
have the parameter sending function. This mechanism is
not normally used, users are not required to pay
attention.
Reconnect
Time
0~255
Once the networking products in a TCP client mode
disconnect with the server (as long as in the non-connection
status), it will initiates a TCP connection to the Server every
while, can be 0~254 seconds, if set 255, never for
reconnection. Note first TCP connection would immediately
(such as hardware on electricity, through zlvircom software
restart equipment, no data), only after the first connection
failure will try again after waiting for the "break time", so
"break time" will not affect the network and server
connection setup time under normal circumstances.
Http Port
1~65535
UDP Group
IP
UDP multicast
Max Frame
1~1400
One of the rules of serial. The connected product serial port

Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com
20
Length
sends the received data to the network as a frame after
receiving the length data.
Max Interval
(Smaller will
better)
0~255
One of the rules of serial. When there is a pause in the data
received by the connected product, and the pause time is
greater than that time, the received data is sent to the
network as a frame.
The functions supported by the device are explained as follows:
Table 5 Device Supported Function
Name
Instruction
Webpage download
Support to control the serial output command through the web page,
only the product with the trailing W has this function.
Domain name system
The destination IP can be the domain name (such as the beginning
of the WWW server address).
REAL_COM protocol
It is a non-transparent transmission serial device server protocol,
which is suitable for the binding of virtual serial port through Internet.
Because the protocol contains the device MAC address, it is helpful
for the upper computer to identify the device. In general, it can be
without use.
Modbus TCP to RTU
Only the models that the third bit is 4 support this function. Modbus
TCP to RTU can be implemented. It also supports multi-host
capabilities.
Serial port modify
parameters
The serial port modification parameter supports the serial port AT
instruction to configure and read the device parameters.
Automatic acquisition of
IP
Support for DHCP client protocol
Storage extension EX
function
Extended later
Multiple TCP
connections
Support more than one TCP connections as a TCP server.
IO port control
Model No. 3 of 4 supports arbitrary custom instructions to control 8
IO outputs.
UDP multicast
UDP multicast
Multi-destination IP
As a TCP client supports simultaneous connection of 7 destination
IP.
Proxy server
Support the proxy server functionality (a specific model is required).
Table of contents
Other ZLAN Gateway manuals