0% found this document useful (0 votes)
19 views80 pages

ZLAN7146 User Manual

Uploaded by

cuong
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views80 pages

ZLAN7146 User Manual

Uploaded by

cuong
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 80

ZLAN7146/7146-5

Multi-function
WIFI Serial Device Server
RS232/485/422 To WIFI

CopyRight©2008 Shanghai ZLAN Information Technology Co., Ltd.


All right reserved
Document DI: ZLDUI 2017.9.13.1.0

1
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

2017-9-13 Rev.1 ZLDUI 2017.9.13.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.

2
Content
1. Summary ................................................................................................................................ 5
2. Function Features ................................................................................................................ 7
2.1 General Software Features .................................................................................... 7
2.2 Advanced Software Function ................................................................................ 8
3. Technical Parameters.......................................................................................................... 9
4. Hardware Instruction ......................................................................................................... 10
5. Wifi Function ....................................................................................................................... 13
5.1 AP Mode.................................................................................................................... 13
5.2 STA Mode.................................................................................................................. 17
5.3 5.8G Usage ............................................................................................................... 17
5.4 Wifi Connection in pairs ....................................................................................... 17
5.5 Antenna Choose ..................................................................................................... 18
6. Using Steps ......................................................................................................................... 18
6.1 Using Overview ....................................................................................................... 18
6.2 Software Installation.............................................................................................. 18
6.3 Parameter Configuration ...................................................................................... 19
6.4 TCP communication test ...................................................................................... 25
6.5 Virtual serial port test ............................................................................................ 28
6.6 Modbus TCP test .................................................................................................... 31
6.7 Web Configuration ................................................................................................. 32
7. Work Mode and Transfer Protocol ................................................................................. 34
7.1 Virtual Serial Mode ................................................................................................. 35
7.2 Direct TCP/IP Communication Mode ................................................................. 36
7.2.1 TCP Client Mode ......................................................................................... 36
7.2.2 The Client connects to Multiple Servers .............................................. 37
7.2.3 TCP Server Mode ........................................................................................ 39
7.2.4 Be both Client and Server ........................................................................ 39
7.2.5 UDP Mode ..................................................................................................... 40
7.3 Device Pairs-connect Mode ................................................................................. 41
8. Device Debugging .............................................................................................................. 43
8.1 Network Physical Connection............................................................................. 43
8.2 Network TCP Connection ..................................................................................... 43
8.3 Data Sending and Receiving ............................................................................... 44
8.4 ZLVircom Remotely Monitor Data ...................................................................... 45
9. Modbus Advanced Features............................................................................................ 46
9.1 Enable Modbus Gateway ...................................................................................... 47
9.2 Storage Modbus Gateway .................................................................................... 47
9.3 Disable Storage Functionality............................................................................. 50
9.4 Multi-host Function................................................................................................ 51

3
9.5 Multi-host Parameter ............................................................................................. 52
9.6 Non-storage Multiple Hosts ................................................................................. 54
9.7 Modbus Under Multi-destination IP ................................................................... 54
9.8 Slave Station Under Client Mode ....................................................................... 55
10. Registration Pack and Heartbeat Pack ................................................................. 56
10.1 Registration Packet ............................................................................................... 57
10.1.1 Connect to send MAC Addresses .......................................................... 57
10.1.2 Realcom Agreement .................................................................................. 58
10.1.3 Custom Registry ......................................................................................... 59
10.1.4 Transcode Configuration Files ............................................................... 60
10.2 The Heartbeat Packets .......................................................................................... 60
10.2.1 Implied Heartbeat ....................................................................................... 61
10.2.2 REALCOM agreement ............................................................................... 61
10.2.3 Customize Heartbeat Packets ................................................................. 61
11. HTTPD Client Communication Function .............................................................. 62
12. Transcoding Functions ............................................................................................. 63
12.1 Enable the Transcoding........................................................................................ 63
12.2 Case of Transcoding Implementation ............................................................... 65
12.3 Notice ........................................................................................................................ 66
13. Network Interface to Modify Parameters.............................................................. 66
14. Device Management Function Library .................................................................. 67
15. Serial Port Modify Parameters ................................................................................ 68
16. Remote device management ................................................................................... 68
17. Firmware upgrade method....................................................................................... 71
18. Multi-wifi Parameter Configuration........................................................................ 73
18.1 Usage scenarios ..................................................................................................... 73
18.1.1 STA Mode Restored to AP ........................................................................ 74
18.1.2 Multi-router Backup ................................................................................... 74
18.2 Wifi.txt File Format ................................................................................................. 74
18.3 Download method .................................................................................................. 76
18.4 Wifi.txt example ...................................................................................................... 77
18.4.1 STA mode restored to AP ......................................................................... 77
18.4.2 Multi-router Backup ................................................................................... 78
18.5 Notice ........................................................................................................................ 78
19. Order information ....................................................................................................... 80
20. After-Service ................................................................................................................ 80

4
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

1. Summary
ZLAN7146 is another serial device server launched by Shanghai ZLAN after

ZLAN7100, ZLAN7142 and ZLAN7144.

7146 adopts the latest WIFI chipset, which has stronger WIFI performance and higher

cost performance. Use ARM M4 kernel, main frequency 192MHz, and use real-time

operating system. The ZLAN7146-5 supports connecting WIFI hotspots of 5.8G

(currently both of them are 2.4G frequency bands in AP mode), and others are similar

to 7146.

7146 supports one RS232/485/422 to WIFI, can be as a STA or AP mode. There is no

Ethernet interface (RJ45 is for future extended use). Support Modbus TCP to RTU,

support sending heartbeat packets, registering packages and transcoding scripts.

Figure 1 ZLAN7146 with Antenna

The high quality power supply design in 9~48V wide voltage provides better industrial

5
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

environment adaptability; Can be equipped with installation guide accessories.

The serial device server can easily make serial device connected WIFI network,

implement the wireless network upgrade of the serial device. RS232 interface support

full duplex, uninterrupted communication. RS485 is embedded 485 lightning

protection. The Wifi supports STA mode to connect to the wireless router, or as AP

mode which mobile phones and other wifi devices can connect to.

For users using virtual serial port can use ZLAN ZLVircom software to achieve a

virtual serial port, the original PC software of serial no need modification. You can also

use the Modbus TCP protocol in the Configuration Software to directly connect with

the RTU device to realize wifi networking communication.

ZLAN7146 can be applied to:

 PLC Remote Wireless Monitoring

 Power /Electronic /Intelligent Instrument

 Bank /Medical Automation System

 Industrial Automation System

 Information Household Appliances

The typical application is shown as FIG. 2. The original serial devices connect with

ZLAN7146, then connect ZLAN7146 to wireless network through the WIFI. Then any

data sent by serial device will be transparently transferred to the PC designated by

ZLAN7146, and data sent to ZLAN7146 from PC via network will also be transparently

transmitted to the serial device.

6
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

Figure 2 ZLAN7146 Network Structure

2. Function Features
2.1 General Software Features

The main function features of 7146 are as below:

1) Support 802.11b/g/n.

2) Wide voltage power supply: 9~48V supply scope. The power input type can

choose industrial terminal or normal power adapter plug.

3) Support three forms of serial port: RS232/485/422. Support hardware flow control

CTS/RTS and software flow control XON/XOFF.

4) Sticky package optimization, the real-time of serial framing is strong. The serial

packet sub-package interval of ordinary WIFI serial port server is over 100ms,

ZLAN7146 is optional 1ms~100ms, resolution precision is greatly improved.

7
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

5) Support upgrading program through Ethernet port in the system. Support remote

network upgrades.

6) Support wifi connection between modules.

7) Provide 4 kinds LINK indicator interface: Link blue indicates the TCP connection

established, LINK green indicates the Ethernet cable is connected, WIFI blue

indicates establishing wifi connection as AP or STA, WIFI green indicates the wifi

function works normal. The abundant indicators can directly shows the device

status.

8) One-key search configuration. When the wifi and PC or router establish link, using

ZLVircom software to one-key search and configure device parameters, the IP of

device and PC no need in a segment.

9) Support DNS, support as a DHCP client, as a AP mode can also be as a DHCP

Server.

10) Support TCP sever, TCP client, UDP/UDP multicast. As Server can support up to

30 TCP connections communicating with the networking module at the same time;

as Client can connect to 7 destination IP.

11) Support the function of device connecting with sending MAC address to facilitate

cloud management of devices.

12) It supports remote viewing of TCP connection status, serial port data sending and

receiving status of devices through software. Virtual serial port supports data

monitoring.

2.2 Advanced Software Function

The 4 in ZLAN7146 means it supports advanced software function, including:

1) Support Modbus gateway function, support Modbus RTU to Modbus TCP. Can

support storage Modbus, and can automatically collect the equipment data. Also

can support non-storage Modbus gateway.

8
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

2) Support for multiple hosts: the network port allows multiple computers to access

the same serial port device at the same time in ask-answer query mode.

3) Support for custom heartbeat and registration package features: easy to do

communication with the cloud and device identification.

4) Support function of needing password authentication when TCP establish

connection to ensure connection security.

5) Support "transcoding" function, which can realize the translation of protocols for

specific devices and allow different devices to connect to the unified software

platform.

6) The data submission and sending function in HTTP mode is supported, and the

cloud can directly use HTTP GET instructions to interact with the serial port data

of the device.

3. Technical Parameters
Figure

Interface: 485: Terminal; 232; DB9; 422: Terminal

Power Supply: Inside positive outside negative, standard outlet; Two lines terminal

Size: L x W x H =9.4cm×6.5cm×2.5cm

Communicate Interface

Wifi 802.11a/b/g/n

Serial RS232/485/422×1: RXD, TXD, GND, CTS, RTS

Serial Parameters

Baud rate: 1200~460800bps Parity: None, Odd, Even, Mark, Space

Data size: 5~9 Flow control: RTS/CTS, XON/XOFF, NONE

WLAN

WLAN Standard: 802.11 b/g/n

Frequency Range 2.412GHz-2.484GHz 5.18GHz-5.825GHz

9
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

2.4G: 802.11b/g/n: +21dBm(Max.);


Transmit Power
5G: 802.11a/n:+16.9dBm

2.4G: 802.11b/g/n:-96.4dBm
Receiving Sensitivity
5G: 802.11a/n:-92.8dBm

Antenna Choice External: external antenna

Hardware

Power 9~24V (50mA when 24V)

Work Temperature -40~85℃

Storage Temperature -45~125℃

Software

WLAN Work Mode STA/AP

Security Mechanism WEP/WPA-PSK/WPA2-PSK

Encryption Type WEP64/WEP128/TKIP/AES

Protocol TCP/UDP/ARP/ICMP/DHCP/DNS/HTTP

Net communication method: Socket, virtual serial port

User Configuration Web Server, Windows configuration tool ZLVircom

Environment

Running temperature: -40~85℃

Storage temp: -45~165℃

Humidity: 5~95%RH

4. Hardware Instruction
The front view of ZLAN7146 WIFI serial server is shown in Figure 3. ZLAN7146 uses

black anti-radiation SECC board. Left and right are with two "ears" to facilitate the

installation.

Size:

L × W × H = 9.4cm × 6.5cm × 2.5cm

10
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

Figure 3 7146 Front View

Panel Light:

1) ACT: ACT lights up when green indicates that data is normally transferred

between WIFI/Ethernet and RS232/485/422. When the ACT light blinks blue, it

indicates that data has been returned from RS232/485/422 to WIFI/Ethernet. If

the data is short then blue flashing time is relatively short, need to pay attention to

view.

2) LINK: LINK lights are green when the RJ45 cable is connected. When the LINK

light is blue, it indicates that the TCP connection is established or is in UDP

mode.

3) POWER: Indicates that the serial server is powered on.

4) WIFI: WIFI light is blue indicates the WIFI as STA establishes wifi connection with

the router or as AP there have wifi connect it.

11
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

Figure 4 Front Interfaces of 7146

The serial interfaces in front of the server area shown in Figure 4, from left

there have:

1) Ethernet port: standard RJ45 interface

2) R-, R+, T+, T-: where T+ is RS485A, T- is RS485B; if you need RS422, you

can connect these four lines.

3) Terminal power supply +, -: voltage is 9~24VDC.

4) Power outlet: you can use the standard 5.5mm plug (core for the positive),

the voltage 9~24VDC.

The back panel of serial server is as shown in Figure 5, from left there have:

Figure 5 The back of 7146

1) WIFI antenna. You can choose the extending line antenna, easy to install to

the outside of the metal cabinet.

12
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

2) Reset switch: putting on the reset mode, will reset wifi work mode to the AP

mode, SSID into ZLAN, password is empty, IP into 192.168.1.254.

3) Serial port using standard DB9 male: line sequence as shown in Table 1:

Item Name Instruction

2 RXD The receiving pins of serial device server

3 TXD The sending pins of serial device server

5 GND Grounding

7 RTS After the flow control is enabled, when the pin is 0, the serial
device server can accept the data of the serial device.

8 CTS After the flow control is enabled, when the pin is 0, the serial
device server can send the data of the serial device.

5. Wifi Function
Install the antenna and power the module.

5.1 AP Mode

Do not plug the cable, put 7146 power on. After a while you can see WIFI_WORK

light began to flash, indicating the wifi function has been normal. By default 7146

is in AP mode and SSID is "ZLAN". See "ZLAN" in the wifi list of PC, connect the

wifi.

13
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

Figure 6 Search for ZLAN hotspots

After connecting the laptop, you can automatically get an IP address from 7146.

Click ZLVircom software "Device Manage" button, you can see a line in the device

list, found 7146 device.

Figure 7 Search for 7146 Device

Double-click the line to open the Device Parameter Edit dialog box.

14
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

Figure 8 Device Parameter Settings dialog box

Here you can see one of the device model ZLAN7146, ZLSN7044 and so on.

Here you can also configure the IP address and baud rate, the meaning of these

parameters will introduce after. Please click on "More Advanced Settings", you

can configure the 7146 wifi parameters in the open dialog box.

Figure 9 Wifi Parameter Configuration

The meanings of the WIFI parameter are as follows:

15
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

Name Option Values Instruction

WIFI Work  Wireless AP: 7146 can be as a


Mode hotspot to be connected by
notebooks, mobile phones, etc.,
mainly for using the configuration in
the first time.
 Wireless Station: As STA mode,
7146 will actively connect a hot
spot (such as a router).
AP or STA A string of 32 bytes or less As an AP, this SSID is the hotspot name,
SSID when as STA mode, it is the SSID of the
pre-connected hotspot. When changing
from STA to AP mode, please pay
attention to modify the SSID, otherwise it
will conflict with the existing SSID on the
network.
Encryption  No encryption: no password mode Generally, when there is no password
type  WEP64: Password length must be choose "no encryption", when there is a
5 characters. password just choose "automatic".
 WEP128: Password length must be
13 characters.
 TKIP: TKIP encryption, password 1
to 32 bytes.
 AES: AES encryption, password 1
to 32 bytes.
 Automatic: usually routers use one
of TKIP and AES, when the user is
not sure, you can choose automatic
mode.
AP or STA Different password length according to As AP mode, this password is the
Password the type of encryption password of computer, mobile phone
connecting to 7146. When used as STA
mode, this password is the pre-connected
AP password.
AP mode 1~11 Only in AP mode the parameter is valid, in
Channel STA mode is invalid.
Choose
DHCP Enable /Disable Easy for mobile phones get IP when
Server connecting the hotspot when as AP.
Recommend to close DHP Server when
non-use, to avoid the DHCP server
allocation conflict with router.
RJ45 Wifi Enable /Disable Only works in 5.8G mode the Ethernet port

16
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

Relay and wifi interworking. Valid for 7146.

If the 7146 as AP mode, it has two types password and no password. No

password mode you just select "no encryption" type; password method is

recommended to use WEP128 encryption, the password length is of 13 bytes.

5.2 STA Mode

When the STA mode is used, the user enters the SSID, encryption mode, and

password of the pre-connected router in FIG. 9. When you do not know the

router's encryption mode can choose "automatic" mode.

When the STA mode is used, 7146 will automatically connect to the AP hotspot

after power-on. At this time, the WIFI_WORK light is flashing quickly, indicating

that it is in the connecting state. WIFI_LINK lights will be on when the connection

is established.

STA mode support automatic reconnection, such as AP hot restart, 7146 can

automatically connect. If you cannot connect to the AP hotspot, please confirm

that whether the encryption mode, password, SSID is correct, whether the

antenna is installed, whether in the signal range.

5.3 5.8G Usage

In figure 9, select enable in "RJ45 WIFI Relay", and it will work in 5.8G mode.

Currently it only supports 5.8G connecting to routers, as 5.8G STA mode. 5.8G AP

mode is not supported.

5.4 Wifi Connection in pairs

7146 support 2 modules via wifi interconnect. Interconnection configuration

parameters are as follows:

Parameters Module as AP Module as STA

WIFI Work Mode Wireless AP Wireless Station

17
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

AP or STA SSID Same Same

Encryption Type Recommended as “no Recommended as “no


encryption" or WEP128 encryption" or WEP128

AP or STA Password Same Same

When the 2 7146 establish connection via wifi, WIFI_LINK light will be on.

5.5 Antenna Choose

If you choose to use the built-in antenna module, no need external antenna, if you

need an external antenna you need to meet the following characteristics, ZLAN

can provide external antenna.

Impedance 50 Ohm

Return loss -10dB(Max)

Connector type I-PEX

Frequency Range 2.4~2.5GHz

VSWR 2 (Max)

6. Using Steps
6.1 Using Overview

Please use ZLVircom to do the configuration for 7146. When 7146 access network

through Ethernet port or wifi, the computer in same LAN can search and configure

the device through the installed ZLVircom software.

6.2 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.

18
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

Table 2 ZLVircom Version

Software Description

ZLVircom Device Management Tool This version no have the virtual serial

(free-installation version) port function

ZLVircom Device Management Tool This version has the ZLVircom_x64.msi

(installation version) 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.

6.3 Parameter Configuration

After installing ZLVircom, the hardware also connecting, run ZLVircom software as

figure 10, and click "Device Manage" as figure 11. 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.

19
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

Figure 10 ZLVircom Main Interface

Figure 11 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

20
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

the "Add Manually" function.

Click the “Edit Device” to configure the device parameters.

Figure 12 Device Parameters

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 3 Parameter Meaning

Parameter Value Range Instruction


Name

Virtual Serial Non-in use, created You can bind the current device to a created virtual serial
virtual serial port port.

21
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

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 The firmware version of core module


Version

Supporting Please refer to the Table 4 “support functions”


Function

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
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 When set to TCP Server, the network Server needs to
Mode),TCP Client(TCP actively connect the networking products; When set to TCP
Client Mode),UDP Client, the networking product initiates the connection to the
Mode, UDP Multicast 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. In the TCP Client or UDP mode, the data will be sent to the
IP/Domain 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.

22
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

Baud Rate 1200, 2400, 4800, 7200, Serial baud rate


9600, 14400, 19200,
28800, 38400, 57600,
76800, 115200, 230400,
460800

Data Bits 5, 6, 7, 8, 9

Parity None, Even, Odd, Mark,


Space

Stop Bits 1, 2

Flow Control None (no flow control), RS232 port valid


CTS/RTS, DTR/DCR,
XON/XOFF

DNS Server When the destination computer is described by a domain


IP 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.

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 NONE, Modbus NONE indicates that the data forwarding from the serial port
Protocol TCP<->RTU, to the network is transparent; Modbus TCP<->RTU will
Real_COM 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 0~255 (1) Choose 1~255, if the device is in the TCP client working
Time 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

23
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

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 0~255 Once the networking products in a TCP client mode


Time 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 UDP multicast


IP

Max Frame 1~1400 One of the rules of serial. The connected product serial port
Length sends the received data to the network as a frame after
receiving the length data.

Max Interval 0~255 One of the rules of serial. When there is a pause in the data
(Smaller will received by the connected product, and the pause time is
better) 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 4 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.

24
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

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 The serial port modification parameter supports the serial port AT
parameters instruction to configure and read the device parameters.

Automatic acquisition of Support for DHCP client protocol


IP

Storage extension EX Extended later


function

Multiple TCP Support more than one TCP connections as a TCP server.
connections

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).

SNMP function Support SNMP to Modbus RTU protocol. Only those with -snmp tails
support this feature.

P2 function Support the ability to access devices in any network through P2P
across technology. This feature is supported in model N with trailing
patches.

6.4 TCP communication test

After the device parameters are configured, TCP connection communication can

be tested with serial port tools and TCP debugging tools.

25
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

Figure 13 TCP communication diagram

Now suppose the PC COM port (USB to RS232 line) connect with serial port of

serial device server, then open the serial debugging assistant ZLComDebug, and

open the corresponding COM as figure 14; Open TCP&UDP debugging assistant

SocketTest, and as TCP client, fill in the destination IP for the serial port server IP

(currently 192.168.1.200), destination port is 4196, and then click "open" button in

figure 15. Enter "socket send" in SocketTest and click send, then the data is

transferred to RS232 interface through the network port of the serial port server,

and then sent to ZLComDebug, which is then displayed in ZLComDebug.

Conversely, type "Comdebug send" in ZLComDebug, and clicking send can also

be sent to socket test and displayed.

The demonstration demonstrates the data transparent forwarding function from

serial port to network port, network port to serial port.

26
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

Figure 14 ComDebug Send-receive Interface

Figure 15 SocketTest Send-receive Interface

27
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

6.5 Virtual serial port test

SocketTest in figure 13 communicates directly with the serial port server through

TCP. In order to enable users to communicate with the serial port server with the

developed serial port software, it is necessary to add a virtual serial port between

the user program and the serial port server. As shown in figure 16, ZLVircom and

the user program run on a computer, and ZLVircom virtual a COM port, so that the

COM port corresponds to the serial port server. When the user program opens the

COM to communicate through ZLVircom  serial device server  to users.

Here's how to do this:

Figure 16 Virtual serial port

Click on the "Serial Manage" of the main interface of ZLVircom, then click "Add",

and select COM5, where COM5 is the COM port that didn’t exist on the computer.

28
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

Figure 17 Add Virtual Serial Port

Then enter the “device manage”, and double-click the device that you need to bind

to the COM5. As shown in FIG. 12, select COM5 from the "virtual serial port" list in

the upper left corner. Then click "modify Settings". And return to the main interface

of ZLVircom. You can see that the COM5 has been connected to a device with IP

192.168.1.200. You can use COM5 instead of SocketTest to communicate.

29
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

Figure 18 Virtual Serial Port has been connected

Now close the before SocketTest and open a new ZLComdebug as the user's

serial port program, now open COM5. At this point, COM5 (virtual serial port) and

COM4 (hardware serial port) can send-receive data through networking products.

If the serial port of the connected product is not connected to the COM port of PC,

but a serial port device, then the COM5 can be opened to communicate with the

device. And it's just use the network way now.

30
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

Figure 19 Communication via Virtual Serial Port

6.6 Modbus TCP test

By default, serial and network data is transmitted transparently. If you need to

implement the Modbus TCP to RTU, requires selecting “transfer protocol” for

"Modbus TCP  RTU" in the Settings dialog, as shown in figure 20. At this point,

the device port is automatically changed to 502. At this point, the user's Modbus

TCP tool is connected to port 502 of IP of serial port server, and the Modbus TCP

instruction sent will be converted into RTU instruction output from the serial port.

For example, the serial port server network port receives the Modbus TCP

instruction of 00 00 00 00 00 06 01 03 00 00 0a, then the serial port outputs the

instruction of 01 03 00 00 00 0a c5 cd. Note: the serial port may send several 01

03 00 00 00 0a c5 cd instructions, because the default Modbus adopts the storage

mode, which will automatically poll to query. It'll show you how to switch to

non-storage.

31
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

Figure 20 Enable Modbus TCP

If the user's Modbus TCP software is used as Slave, it is necessary to change the

working mode to client based on the transfer protocol selection, and the

destination IP change to the computer IP of Modbus TCP software, and the

destination port is 502, as shown in figure 21.

Figure 21 Modbus TCP as Client

6.7 Web Configuration

ZLVircom can be used to search and configure device parameters in different

network segments. The configuration of the Web mode requires that the computer

and the serial port server are in the same IP segment, and the IP address of the

serial port server should be known in advance. But the Web configuration can be

done on any computer without ZLVircom.

32
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

1) Enter the IP address of the serial port server in the browser, such as

http://192.168.1.200, to open the following page.

Figure 22

2) Enter Password in Password: default is 123456. Click the login button to

login.

Figure 23 Web configuration interface

3) The serial port server parameters can be modified in the web page that

appears, and the related parameters can refer to the meaning of the

33
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

parameters in table 3.

4) After modifying parameters, click the "submit" button.

7. Work Mode and Transfer Protocol


In different applications can choose different work mode, transfer protocol of the serial

server, so as to be more stable and reliable use, the details are as following.

The use of serial device server is basically divided into two types: with virtual serial

port and non-virtual serial port, as shown in fig.13 TCP communication diagram and

fig.16 function of virtual serial port. The user software with virtual serial port needs to

be connected is the COM port, that is, both the user software and the user device are

serial ports. Non-virtual serial mode user software communicates directly over TCP/IP

but user devices are still serial.

In the non-virtual serial port mode, the "Transfer Protocol" is divided into transparent

transmission, Modbus TCP to RTU and Realcom protocol. If the user software is a

fixed Modbus TCP protocol and the host computer is Modbus RTU, Modbus TCP to

RTU mode should be selected. The Realcom protocol is currently only used when a

multi-port server is connected to a server as a TCP client and a virtual serial port is

used on the server.

Usage is summarized as follows:

Table 5 network configuration modes


No. Virtual Device Transfer Protocol Instructions
Serial Port Work
Usage Mode
1 Use TCP None Suitable for the user to open the COM
Server port to collect data actively.
2 Use TCP None Suitable for the occasion when the
Client device sends data actively. If the TCP
server is selected, the problem that the
device cannot be reconnected after
being disconnected may occur.
3 No Use TCP Modbus TCP to The user software is Modbus TCP, and

34
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

Server RTU the user device is Modbus RTU.


Modbus TCP is the main station.
4 No Use TCP Modbus TCP to The user software is Modbus TCP, and
Client RTU the user device is Modbus RTU. And
Modbus RTU is the main station.
5 Use TCP Realcom Protocol When using a multi-port server as a
Client TCP client and the virtual serial port is
used, it is best to use the Realcom
protocol.
6 No Use TCP None Suitable for a large number of devices,
Client connected to a cloud way. And under
normal circumstances the cloud is a
server of public network IP on the
Internet.
7 No Use TCP None Suitable for devices and computers in
Server the same local network, do local
monitoring, no need to communicate
across the Internet.

7.1 Virtual Serial Mode

If the user software is using COM port for communication, it must use virtual serial

port mode. Including some PLC software, configuration software, instrument

software, etc.

Then check whether the monitoring computer and equipment are in the local

network:

1) If the computer is a public network IP server rented over the Internet, then the

device must use TCP client mode to connect the device to the server. At this

point, you can select the (2) and (5) in Table 5, and must select (5) if it is a

multi-port server.

2) All in the local network (can ping each other), then see is the upper computer

active query or device active send data. If the device is sent initiatively it must

use the device to be TCP client as (2) in Table 5, or you can choose the (1)

way.

35
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

7.2 Direct TCP/IP Communication Mode

If Modbus TCP conversion is not required and virtual serial port is not required, the

user software may directly communicate with the network port of the serial port

server for TCP/IP communication, and the serial port server will transfer the

TCP/IP data to the serial port data and send it to the serial port device.

Generally, users of this kind of usage develop the network communication

software of upper computer by themselves and integrate the analysis of the serial

communication protocol of the equipment. This method is more flexible and

efficient than virtual serial port. Correspond to (6) and (7) in table 5.

In the section of "6.4 TCP Communication Test", it mainly introduces how to

communicate when the serial port server is a TCP server. Here you will learn

about TCP clients, UDP mode, and how multi-TCP connections communicate with

computer software. The computer software takes SocketTest (the software that

imitates the user's TCP/IP to communicate) as an example.

ZLAN serial port server is in compliance with the standard TCP/IP protocol, so any

network terminal that conforms to the protocol can communicate with the serial

port server. ZLAN technology provides the network debugging tool (SocketDlgTest

program) to simulate the network terminal to communicate with the serial port

server.

For two network terminals (in this case, the network debugging tool and the serial

port server) to be able to communicate, the configuration of the parameters must

be matched.

7.2.1 TCP Client Mode

There are two operating modes under TCP mode: TCP Server and TCP

Client. No matter which mode is adopted, one side must be the Server

side and the other side the Client side. Then the Client side can access

the Server side.

36
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

When the serial port server is the Client, there must be three

corresponding relationships, as shown in figure 24. 1) working mode

correspondence: the working mode of the serial port server is the Server

mode corresponding to the Client mode of the network tool; 2) IP address

correspondence: the destination IP of the serial port server must be the IP

address of the computer on which the network tool is located; (3) port

correspondence: the destination port of the serial port server must be the

local port of the network tool. In this way, the serial port server can

automatically connect to the network tools, send and receive data after the

connection is established.

Figure 24 The serial port server as the Client

7.2.2 The Client connects to Multiple Servers

When the ZLAN serial port server is a TCP client, it can connect to 7

destination IP addresses at the same time, and the data sent by the serial

port will be sent to 7 destination IP addresses at the same time. If you

don't have that many servers, the rest of the destination IP is vacant. Its

use method is as follows:

37
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

Figure 25 The first destination IP and port

Figure 26 The rest 2~7 IP and ports

The first IP is set in the device settings interface shown in figure 25, where

the first IP can be the domain name. For the remaining 2~7 destination IP,

click the "More Advanced Options" button in the device setting interface

and open more advanced options for setting.

All 7 destination IP Settings can be automatically connected, if not

connected, will wait for "disconnect reconnect" time after repeated

reconnect.

Note that if the wifi parameter is set, the number of multi-destination IP will

be reduced (because the wifi parameter is temporarily used in the

parameter configuration table). If you still need to maintain multiple

38
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

destination IP and need to configure the wifi parameter, please use the

format of 18.2wifi.txt file to configure the wifi parameter, and leave the

parameter table empty.

7.2.3 TCP Server Mode

When the serial port server acts as a Server, there are also three

corresponding relationships, as shown in figure 27. There is no

explanation here. After this setting, click the open button of the network

tool to establish a TCP connection with the serial port server, send and

receive data after the connection is established.

Figure 27 The serial port server as the Server

When the serial server is as Server, it can accept 30 TCP connections

simultaneously. The data received by the serial port is forwarded to all

established TCP connections. If the data need to be sent only to TCP that

has recently received network packets, multi-host function needs to be

enabled. Please refer to “9.4 Multi-host Function”.

7.2.4 Be both Client and Server

The ZLAN serial server supports accepting TCP connections when the

device is on a TCP client, which means that it also has TCP server

functions.

39
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

Figure 28 Both Client and Server

By default, when configured with ZLVircom, if the working mode is

changed to "TCP Client" mode, the port (that is, the local port)

automatically becomes 0 (0 means a random free port is selected). In

order to support the TCP Server mode, the computer software must know

the local port of the device, so a value needs to be specified. As shown in

figure 28, the computer software can now connect to port 1024 of

192.168.1.200 for communication, and the device will also connect to port

1024 of 192.168.1.189 as the Client. It should be noted that since the local

port 1024 is occupied by the Server, when the local port is used as the

Client, it is "port +1", that is, the software on 192.168.1.189 sees that the

incoming port of the device is 1024+1=1025.

7.2.5 UDP Mode

In UDP mode, the parameter configuration is shown in figure 29. The left

side is the configuration of the serial port server in ZLVircom, and the right

side is the setting of the network debugging tool SocketDlgTest. First, both

must be UDP working modes. In addition, as indicated by the red arrow,

the destination IP and destination port of the network tool must point to the

local IP and port of the serial server. As indicated by the blue arrow, the

destination IP of the serial port server must be the IP address of the

40
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

computer where the network tool is located, while the destination port of

the serial port server must be the local port of the network debugging tool.

Only when these network parameters are configured the two-way UDP

data communication can be guaranteed.

Figure 29 UDP mode parameter configuration

7.3 Device Pairs-connect Mode

If the upper machine is not a Socket program (SocketDlgTest) or a virtual serial

port, but two devices are connected through a network port, the configuration

method is similar. First, the user needs to connect two devices and computers to

the same LAN. ZLVircom runs on this computer and is only connected to the

computer for configuration purposes, after which the computer does not need to

be connected.

Click ZLVircom's device management to find the two devices, as shown in figure

31. Then click "Device Edit" to configure the device. Device pair-connection can

be divided into TCP pair and UDP pair. In the case of TCP pairing, the parameters

of the two devices are shown in figure 30. The parameters shown by the arrows

must correspond as if they were connected to a PC. After a successful TCP

connection, you can view the connection status by going back to the device

management dialog box, as shown in figure 29. If both devices are "connected",

41
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

the TCP link for both devices has been established.

Figure 30 TCP device pairing parameter configuration

Figure 31 successful TCP device pairing check

In the case of UDP pair-connection, the configuration parameters are shown in

figure 32, and the parameters corresponding to the arrows must be one-to-one. As

long as the parameters of UDP pair are configured correctly and the connection

status is not checked, the data sent will be automatically sent to the specified

device.

42
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

FIG. 32 configuration of UDP device pairing parameters

Finally, we need to remind that if the device is connected to each other, in addition

to the above settings of the Ethernet port parameters, the serial port parameters

must also be correctly set. Mainly is the serial port server baud rate and so on

needs to be consistent with user's equipment baud rate and so on. With this setup,

the user device can send data to each other through the serial ports of the two

serial servers.

8. Device Debugging
8.1 Network Physical Connection

Confirm the wifi connection is normal through wifi_work and wifi_link indicator

lights.

8.2 Network TCP Connection

When the device is in dynamic accessing IP mode, cannot directly connect to the

computer network interface. Because no have DHCP server to be able to use

(general DHCP server is the router in LAN). So please specify IP when connecting

directly. The computer also needs to specify a fixed IP address.

43
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

Figure 33 configure on the same network segment

When configured with static IP, both the device and the computer need to be on

the same network segment (unless communicating across gateways), either

directly or through a switch, as shown in figure 33.

Since ZLVircom supports cross-segment search and configuration, the IP address

that can be searched but cannot be communicated is usually not well configured.

In this case, ZLVircom can be used to configure devices in the same network

segment.

After the configuration, the Link light turns blue when the TCP connection is

established by using the steps of “6.4 TCP Communication Test” or “6.5 Virtual

Serial Port Test”. The Link light blue can also be seen through ZLVircom, as in the

device management list, if the TCP connection is listed as "established" then the

Link light is blue, as shown in figure 34, which facilitates remote diagnosis.

Figure 34 Connection status and data send/receive status

8.3 Data Sending and Receiving

When the Link light turns blue, data can be sent and received between the

software and the serial port server. If the software sends a message, the Active

44
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

light turns green for at least a second. The data is also output from the serial port

server, but whether the output data is correct depends on whether the correct

serial port parameters (baud rate, data bit, stop bit, check bit) are configured.

The serial device will reply to the right instruction. If there is a reply (the serial port

sends data to the network port), “Active” will turn blue. Otherwise, please check

the serial port parameters or the connection of the serial port line.

In order to facilitate remote debugging, ZLVircom also supports remote viewing of

data sent and received, as shown in figure 34, where TXD is the amount of data

sent by the serial port server. When refreshing the list of devices, a change in this

value indicates that data has been sent, and the Active light is also green. If you

see a change in the RXD value it indicates that the serial device has returned data.

Active is blue.

8.4 ZLVircom Remotely Monitor Data

In the case of virtual serial port, ZLVircom supports real-time capture of data sent

and received from the virtual serial port. It is convenient for users to debug the

system. The use method is as follows:

It is assumed that the virtual serial port communication has been established

according to the “6.5 Virtual Serial Port Test” method. Now you need to monitor

the data passing through the virtual serial port. Open the ZLVircom

menu/configuration/software configuration/open the vircom configuration dialog

box.

45
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

Figure 35 enabling ZLVirocm monitoring

Select the three options of enable monitoring, hexadecimal monitoring mode, and

display the time of send-receive data, as shown in figure 33. Then click ok.

Assuming that data has been sent and received before, now select a virtual serial

port to be monitored in the main interface, and then select the menu/view/monitor,

as shown in figure 36.

Figure 36 Open ZLVirocm monitoring

From the open dialog box, you can see the instructions issued by the upper

computer and the instructions returned by the device, as shown in figure 37. This

function can be convenient for field communication debugging.

Figure 37 monitor send-receive data

9. Modbus Advanced Features


The serial port server with Modbus gateway function does not have station address

46
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

and register. It is a communication bridge. It will generate Modbus RTU designation

according to Salve ID, function code, register No. and register number in Modbus TCP

instructions sent to Modbus gateway by user software and output them from the serial

port. Think of it as a protocol "translator."

9.1 Enable Modbus Gateway

First of all, the serial port server should support Modbus gateway, that is, the

function of "Modbus TCP to RTU" supported by devices in table 4 in the device

Settings dialog box should be checked.

By default, a serial port server is in ordinary transparent transmission mode, if you

need to Modbus gateway pattern, please choose the option "Modbus

TCPRTU" in the "transfer protocol". The device then automatically changes

the "port" parameter to 502 (the Modbus server's port). The Modbus gateway is

thus enabled.

If the serial port RTU device is the slave station, then the host computer Modbus

TCP software connects to port 502 of Modbus gateway. At this time, Modbus

gateway needs to work in TCP server mode. If the serial port RTU is the main

station, the Modbus gateway works on the TCP client side, and the destination IP

fills in the IP of the computer on which the Modbus TCP software resides, and the

destination port is generally 502.

9.2 Storage Modbus Gateway

7146 is a Modbus gateway with register storage. Compared with ordinary

ZLAN5142 (the end of which is 2 or 0 is non-storage), 7146 can save the read

contents of the registers in the gateway. In this way, the speed of Modbus TCP

query can be greatly improved, and the performance is superior when supporting

multi-host access.

47
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

Figure 38 Storage Modbus Gateway

As shown in figure 38: ordinary Modbus TCP data flow direction (1)(2)

(3)(4). In other words, Modbus TCP instruction is first converted into

corresponding Modbus RTU instruction, and then the device responds Modbus

RTU instruction to Modbus gateway, which is then converted into Modbus TCP

again and sent to the monitoring host computer.

As we know, Modbus TCP is a network communication with a fast transmission

speed, which can be answered within 3ms, while Modbus RTU is RS485 with a

speed of only 9600bps. Generally, it takes at least 30ms to send and return an

instruction. Such a common non-storage Modbus gateway has a relatively long

48
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

query response time. In addition, if there are many upper computers to query data

at the same time, the serial port will be congested. If the network is compared to

the highway, the serial port is compared to the single-log bridge, then the original

way is to pass the traffic flow of the highway on the single-log bridge.

Register save Modbus Gateway (7146) solves the above problem. It can

temporarily save the register data obtained from the query in the Modbus gateway,

so that when Modbus TCP query comes, Modbus gateway can immediately return

the instruction, and truly give play to the rapid characteristics of Modbus TCP. On

the other hand, 7146 can actively send instructions from the serial port to

automatically update the data content of the currently saved register and save a

copy of the latest register value.

In addition, 7146 is a fully automatic Modbus Gateway without configuration.

Users do not need to configure required register addresses, function codes and

slave station addresses. The 7146 will automatically recognize and dynamically

add these registers according to Modbus TCP instructions sent from the network

port.

When monitored by multiple computers, 7146 can show a good response speed.

Regardless of the baud rate of the serial port, it can generally give the upper

response data within 3ms. And it shows a good real-time update speed of serial

data.

Modbus gateway with register storage is a real Modbus TCP to Modbus RTU,

which gives full play to advantages of fast speed and multi-host simultaneous

query of Modbus TCP.

Note that when the serial server is a TCP client, it does not have a storage

function and will automatically switch to a non-storage type.

The features of the storage Modbus are listed below:

1) The first Modbus TCP query instruction is non-stored. Because you have to

49
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

wait for the RTU device to slowly return data before returning the register

contents to the network port.

2) If a particular instruction is no longer queried by the host computer on the

network side within 5 seconds, the instruction is automatically deleted and no

longer sent from the serial port to the RTU device.

3) Currently, it can store 10K Modbus cache. For ordinary single-register query,

about 500 instructions can be stored at the same time.

4) When there are multiple instructions at the same time were queried, send in

accordance with the order, send first instruction  first instruction reply 

wait for 485 anti-collision time (refer to many host part)  the next instruction

to send... . Return to the first instruction after the last instruction has been

answered.

9.3 Disable Storage Functionality

Although the stored Modbus has a fast response speed, some users do not want

the RTU device to receive a large number of query instructions, which will affect

the internal processing speed of the instrument. You can turn off the storage

function at this point.

To disable storage, click the “more advanced options” button in the “Parameters

Setting” dialog box and remove one of the support and one of the enable options

shown in figure 39 by clicking ok. Then go back to device Settings and click modify

Settings.

Note that when configuring the transfer protocol in a Web method, the default is a

non-storage Modbus gateway.

50
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

Figure 39 disables the storage function

9.4 Multi-host Function

As shown in figure 39, "RS458 multi-host support" and "RS485 bus collision

detection function" are ZLAN's multi-host functions. They are generally both

enabled and disabled at the same time. After enabling, the device that converts

the protocol into Modbus TCP has the function of storage Modbus gateway;

otherwise, it is a non-storage Modbus gateway. If the conversion protocol is none,

generally, the user-defined RS485 protocol can also have the function of serial

devices accessed by multiple hosts at the same time, which cannot be achieved in

the pure RS485 network, because the sending of multiple master stations at the

same time will cause conflicts on the RS485 bus. The multi-host of ZLAN serial

port server can "coordinate" the RS485 bus so as to achieve the purpose of

multi-host access.

51
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

Figure 40 multi-host function demo

As shown in figure 40, in normal mode, when two hosts, host A and host B, are

connected to the serial port server at the same time, host A sends (1) instruction,

RS485 device receives (2) instruction, and RS485 device returns (3) instruction,

but the serial port server sends (4) to host A and (5) to host B at the same time.

Since host B did not send a query, but it also received a reply instruction (5), host

B may generate a communication exception error. In the multi-host mode, only

instructions (4) will be given and no instructions (5) will be given, because the

serial port server will automatically remember the host that needs to be returned

and only return the instructions to the nearest communication host. The query of

host A will only reply to A, and the query of host B will reply to host B.

Another effect is that in normal mode, when host A and host B send data at the

same time, the instruction combination will be generated on the RS485 bus, so

that it cannot be recognized normally. In the multi-host mode, the serial port server

can schedule the priority of A and B on the use bus, so as to solve the conflict

problem of simultaneous access of multiple machines in an effective manner.

If the conversion protocol is "none", the default is not to enable multi-host function.

If you need to enable multi-host, please click "more advanced options" in the

device configuration dialog box, and then check "RS485 multi-host support".

9.5 Multi-host Parameter

The meanings of "RS458 multi-host support" and "RS485 bus collision detection

function" are described as follows.

52
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

Figure 41 RS485 multi-host support

RS485 instruction reply timeout is: the maximum time interval between the start of

sending this instruction and the receipt of the reply by the serial port server. The

filling time should be greater than the actual maximum time interval. If the timeout

is determined, the next instruction is sent.

Figure 42 RS485 conflict free time

RS485 bus collision time: indicates how many milliseconds the serial server waits

to send the second instruction after receiving the reply of the first instruction. This

parameter actually defines the speed of instruction rotation. This value is

recommended above 20ms. The "maximum wait time is 3 seconds" parameter

does not need to be modified.

When the user use ZLVircom to select "Modbus TCP to RTU" as the transfer

protocol, ZLVricom will automatically select the above two enabled boxes (unless

the user manually enters the advanced option to remove), and the above two

times will be automatically configured according to baud rate. However, if the

user's Modus instruction is relatively long or the conversion protocol is "none",

these two parameters need to be manually configured.

The following is the recommended setting values of the above parameters:

1) Figure 42 shows the "RS485 bus anti-collision time", which can be set as

twice of the "packet interval" in the lower right corner of the parameter

configuration interface, but the minimum value should not be less than 20.

2) Figure 41 shows "RS485 instruction reply timeout time", which is generally

determined according to the length of the reply instruction. If the sending

instruction is N bytes and the reply is M bytes, the recommended value is:

53
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

"packet interval" * (N+M+5) +100.

9.6 Non-storage Multiple Hosts

In some places, non-stored Modbus must be used. This is because when an event

occurs, PLC will read the data in the register, but the data read is the data before

the storage collection, which is logically incorrect. Therefore, 7146 must also

support non-stored Modbus collection. However, on the other hand, it is also

necessary to support multiple hosts at the same time. In order to cooperate with

this approach, the maximum waiting time of RS485 bus can be changed to "2" on

the basis of stored Modbus gateway (using 1.565 and above version of firmware).

The 2 here is a special value that lets the module know that it needs to disable the

stored function.

Figure 43 multi-host non-storage Settings

Note that each time Modbus TCP mode is set, the value must be set to 2 again,

because re-selecting Modbus mode will automatically change to 3.

In this way, the functions of Modbus in model 3 will be similar to that of ZLAN5142,

with multiple hosts and no storage functions.

9.7 Modbus Under Multi-destination IP

As shown in figure 40, if the serial port device (RTU device) is the master station

54
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

and the Modbus TCP device (Modbus TCP device) is the slave station, and

multiple network port slave station devices exist simultaneously. In this case, the

serial port server can be used as the client to connect to multiple network port

devices at the same time according to the method introduced in “7.2.2 Client

Connect to Multiple Servers”.

At this point the need to achieve the function is: when instructions sent from the

serial RTU can be sent to more than one network device, the network device

identify whether to send their own through the Slave ID field, only the network

devices corresponding to Slave ID make a response. After the network port reply

is sent to the serial port server, it is converted into RTU instruction and output from

the serial port to the RTU device.

At this point, it is important to note that the two checkmarks shown in figure 42 as

"RS485 bus anti-collision time" and figure 41 as "RS485 instruction reply timeout

time" need to be removed. Otherwise, the above forwarding function cannot be

realized.

Another application method is that although the serial port server connects

multiple network port devices as a Client, the RTU device is not the main station,

but the network port device sends first and the RTU device answers (as the slave

station). At this time, "RS485 bus conflict prevention time" and "RS485 instruction

response timeout time" need to be checked, so that multiple hosts can access a

RTU device at the same time.

9.8 Slave Station Under Client Mode

Sometimes 7146 is used as a client to connect to a cloud server. But 7146 as the

slave station, that is, the cloud is the active query, 7146 response mode.

55
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

Figure 44 Modbus TCP conversion in Client Mode

Special Settings are required to keep the serial Numbers of the send and reply

consistent.

Figure 45 Modbus TCP protocol transformation in Client Mode

Set the total idle time to 4, which is a special value to let 7146 know to switch to

TCP client/cloud priority mode above the reply number.

10. Registration Pack and Heartbeat


Pack
Registration and heartbeat packs are a feature that suitable for communication

between devices and cloud-based software.

56
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

10.1 Registration Packet

The registry is defined as a string of code that is sent to the software when a TCP

connection is established between the computer software and the serial server

module (hereinafter referred to as the module) so that the software knows which

module is communicating with it. This string of codes is the registry.

The registration package is very suitable for the monitoring of the Internet of things,

because the cloud software generally runs on the public network server of the

Internet, while the modules are scattered in various collection and monitoring

points. How to make the cloud software identification module is very important and

necessary for the realization of Internet of things communication.

Shanghai ZLAN serial server to provide the following types of registration.

10.1.1 Connect to send MAC Addresses

Connect to send MAC addresses: this is not only for model 4 (like 5143),

but also for regular models. It does this by sending its MAC address to the

cloud when the module is connected to the cloud. Since the MAC address

is unique, the device can be uniquely identified. This approach is simple

and effective without having to write a registry for each device. To use it,

click "more advanced options" in the device Settings dialog box, find "send

MAC address when TCP is established" in the middle and upper part,

check the box in the front, then go back to the Settings interface and click

"modify Settings".

57
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

Figure 46 Connect to send MAC Addresses

10.1.2 Realcom Agreement

The Realcom protocol is a mature protocol with registry and heartbeat

packages that users can use to implement registry and heartbeat package

functionality. The way to enable Realcom protocol is to select

"REAL_COM protocol" as "REAL_COM protocol" in the device Settings

dialog box.

Figure 47 Enable the realcom protocol

It is not a transparent transport after the Realcom protocol enabled. It has

the following features:

1) When a TCP connection is established between the device and the

cloud, the device automatically sends a hex registry FA 07 13 02 FA

02 MAC[5] MAC[4] MAC[3] MAC[2] MAC[1] MAC[0] FA FF. The

MAC[5]~MAC[0] is the MAC address of the device.

2) When the device sends data to the network, it will automatically add

the 3-byte header prefix of FA 01 01.

3) The device sends a 00 byte heartbeat packet to the software every

keep-alive time.

The REAL_COM protocol can be used as a registry for devices because

the registry contains MAC addresses. But because it is a fixed format, it

can only be designed in the cloud software that REALCOM protocol to be

58
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

compatible with this way.

10.1.3 Custom Registry

The custom registry format allows users to fill in an arbitrary registry

format. The method is: in the device setting interface, the configuration is

as follows:

Figure 48 Set up the registry

The difference with the REAL_COM protocol is that the registry is enabled

and the registry information 31 32 33 34 is filled in. Note that this is

hexadecimal, which means that the actual data sent is the string 1234. If

you need a string display, click the "ASCII" option.

When the device is connected to the cloud software, it can automatically

send the hexadecimal registration package of 31 32 33 34. This

registration method is more flexible, can let the device to adapt to the

existing cloud registration format; However, there is no wildcard like MAC

in the registry, so it is tedious to configure a different registry for each

device. The above two methods of sending MAC addresses and

REALCOM are the same for each device configuration, but they are

naturally different for different MAC registries.

The maximum registered package length is 33 bytes. This mode supports

UDP mode registration packages and heartbeat packages.

Note that if the wifi parameter or multi-destination IP parameter is set, it

59
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

will conflict with the custom registry heartbeat packet. At this time, it is

recommended to use the transcode configuration file described in the next

section to realize the registry and heartbeat packet.

10.1.4 Transcode Configuration Files

ZLAN 5143 series supports the "transcoding" function, which can write a

transcoding configuration table for the serial server, so as to realize the

user's fully customized registration package, and can use MAC address

wildcard, can solve the trouble of writing a custom registration package for

each device, and there is no limit on the length of the registration package.

Specific use method can consult ZLAN about "transcoding" function

configuration, or refer to “12 Transcoding Function”.

10.2 The Heartbeat Packets

Heartbeat packet is mainly used to detect whether the communication link is

disconnected. The implementation method is that the device sends a heartbeat

packet data to the server software every once in a while, which will be discarded

by the server after receiving and will not be regarded as valid data for

communication.

Heartbeat packet has two main functions: first, it can let the upper computer

software know that the device is in the active state; Secondly, if the device fails to

send a heartbeat, the device on the TCP client will automatically re-establish a

TCP connection, so it is a means to restore network communication.

60
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

FIG. 49 Keep-alive time

As shown in figure 49, the sending time of the heartbeat packet is set by the "Keep

alive time".

10.2.1 Implied Heartbeat

Even if no heartbeat packets are set, the ZLAN device enables the implied

heartbeat when it is on the TCP Client. Therefore, the implied heartbeat

function means that the device has sent data, but the server cannot

receive the heartbeat data. Therefore, it cannot play the first function of

heartbeat packet, that is, the server can detect whether the device is

active or not. However, since the device actually sends data, it can play

the second function of heartbeat packet, that is, the function of the device

to detect whether the TCP connection is normal. Once the detection is

broken, the TCP connection can still be re-established automatically.

10.2.2 REALCOM agreement

As described in the “10.1.2 Realcom Protocol”, the Realcom protocol can

send a byte data of 00 at every guaranteed time, which is the heartbeat

packet of the Realcom protocol.

10.2.3 Customize Heartbeat Packets

First, fill in the registration package according to the method of “10.1.3

Custom Registration Package”. Then increase the heartbeat packet as

61
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

follows: click the "more advanced options" button in the device Settings,

write the hexadecimal heartbeat packet in the second line of the

multi-destination IP and port, and change the option on the right to

"Parameter Packet Destination".

Figure 50 Custom Registry

Note that the total number of registered and heartbeat packets is less than

33 bytes. The first line is actually the registry.

11. HTTPD Client Communication


Function
This function is used to send the data from the serial port server directly to the server

program based on the web architecture, which can simplify the software development

workload in the cloud.

When the collection terminal of the Internet of things interacts with the web server

(HTTPD program), if the data can be submitted to the web server in the standard

format of HTTP GET and POST instructions, the web server can use the existing PHP

/asp language to process and store the data. This saves the user the effort of

redeveloping the web application interface.

To support this feature, download a configuration file of httpd.txt from the ZLAN serial

port server. Download can be done using the firmware upgrade feature of zlvircom.

The features of ZLAN HTTPD Client communication include:

1) Device send: support to directly convert serial data into HTTP format by

GET/POST, which can be directly recognized by the server.

62
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

2) Web server issue: the Web server can also send the required data to the serial

port server through the GET/POST instruction, where the valid data content can

be output from the serial port of the serial port server. When the serial server

receives the data, it can also send a specific reply to the Web server indicating

that the data has been received.

3) Support arbitrary conversion of input and output data between hexadecimal and

string, convenient for the Web server to send data in character mode, and the

serial port to control the serial device in hexadecimal data output.

For more information, please refer to the "ZLAN HTTPD Client Communication Mode"

document.

12. Transcoding Functions


ZLAN serial port server transcoding function can achieve different device protocol into

a unified protocol function.

Table 6 Transcoding Examples


Ethernet Port Instruction Serial Port Instruction
01 02 03 04 a1 a2 a3 a4
11 12 13 14 b1 b2 b3 b4
21 22 23 24 c1 c2 c3 c4

As shown in table 5, when the network port receives 01 02 03 04 the serial port will

output instructions of a1 a2 a3 a4. Similarly, when the serial port receives b1 b2 b3 b4,

the network port actually sends 11 12 13 14. This enables the conversion of different

protocols. This is just a simple example of a "transcode" function that can actually be

converted to more complex protocols.

12.1 Enable the Transcoding

The configuration files converted by the command are written to the httpd.txt file

and then downloaded to the ZLAN serial port server. To do this, create a new

63
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

httpd.txt document in the web page directory. If the user does not have a web

directory, make a new webs directory and then make a separate httpd.txt file.

Figure 51 Web Directory

Now click the "upgrade firmware" button in "device configuration", and the web

and firmware download page will pop up:

Figure 52 Download of http.txt

As shown above, select the web directory to download, then select the web

directory you just created, and then click the "download" button to download

httpd.txt into the device. Above IP, model, space size, port will be automatically

filled in without configuration. Note: any time httpd.txt is updated, the device needs

to be repowered.

64
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

12.2 Case of Transcoding Implementation

Because transcoding function is more complex, the length is longer. Without going

into detail here, it is also possible to write the configuration file httpd.txt by using

ZLAN engineer if necessary. ZLAN can also provide the configuration file httpd.txt

for the existing case. At present, there are several typical cases as follows:

1) Fixed command translation and conversion.

2) Complex command conversion: the conversion of commands with wildcards,

which can be shifted and assembled, such as the conversion of non-standard

RS485 instructions into standard Modbus RTU instructions.

3) Multi-TCP connection recognition: when there are multiple TCP connections,

the network port send data to the serial port will increase 4 byte prefix of IP+

port. When a serial port is connected to a network port, the IP address + port

can also be added to send data to the specified TCP connection.

4) Add the MAC address before sending TCP or UDP to identify the device.

5) IP filtering: the device only receives data from the network port with the

specified IP address.

6) IO pin control: control the level of some output pins by any specified

command.

7) Automatically query the content of the instrument of the lower computer,

assemble the returned instruction and send it to the cloud software in a fixed

format.

8) Implement heartbeat packets and registration packets with wildcards of any

length.

9) Multiple serial instructions are combined and sent to the cloud after the

combination.

10) The super-long serial instruction is split into several smaller instructions to be

65
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

read by the network device.

12.3 Notice

1) When “httpd.txt” is not stored, the device will be used as a normal serial port

server. Transcoding is disabled.

2) To delete “httpd.txt” you can simply change “httpd.txt” to “1.txt” and then

download it again. Re-downloading the firmware of the device will also delete

the “httpd.txt” file, and downloading the firmware progress bar will delete the

“httpd.txt” file if it only moves 1 frame. Refer to the following sections for

download firmware methods.

3) The device must be restarted after downloading the “httpd.txt” file.

4) When an “http.txt” editing error causes syntax parsing to fail, which can cause

a device startup exception, set the “def” switch (reset switch) of the device to

“On” and re-power it. This will start without “httpd.txt”. Please download the

new “httpd.txt” or delete “httpd.txt” and then set “def” back to the “Off”

position.

13. Network Interface to Modify


Parameters
Network interface modification parameter is a function to search and modify

device parameters like zlvircom software, that is, to manage the device and

modify parameters through the network interface of the serial port server. Suitable

for users who integrate search and configuration functions into the user's

software.

Network interface modification parameters are realized through "UDP

management port protocol", such as:

1) Computer software sends UDP broadcast packets with destination port of

66
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

1092 in the network. When the device receives the data packet, it will return

its information to the computer software to achieve the purpose of searching

the device.

2) The computer software sends the UDP modification parameter command to

the 1092 port of the device to achieve the purpose of modifying the device

parameter.

The detailed introduction of network interface modification parameters can be

referred to the document of "UDP Management Port Protocol of ZLAN Networking

Product". It can also be implemented directly using the device management

function library of the “14 Device Management Function Library”.

14. Device Management Function


Library
This feature is suitable for users who need to integrate device management

functions into their own software.

The described "UDP management port protocol" is integrated into the device

management function library ZLDevManage. This is a Windows platform

development library of DLL, can be called by VC, VB, Delphi and other

development tools.

Provide detailed API interface introduction documents and VC call Demo case.

Can realize the device search, parameter modification, P2P function call and so

on.

Can be gained from ZLAN website development libraries: search for "equipment

management function library" in http://zlmcu.com/download.htm pages. Please

refer to "ZLAN WinP2p and equipment management development library" for

details.

67
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

15. Serial Port Modify Parameters


Users can read and set parameters by sending instructions to the serial port of the

serial port server. Suitable for users choose chip or module level products to

control and configure through the serial port. Parameters that can be set include:

IP address, baud rate, device name, working mode, etc. After setting the new

parameters, you can restart the serial port server through the serial port

instruction.

ZLAN serial instruction has the following characteristics:

1) The serial instruction uses 10 bytes of data leading code, so there is no need

to distinguish the communication data or command through the pull down and

pull up of another configuration pin, and there is no need to switch the

command mode and communication mode, which is more flexible and

convenient to use.

2) The command set contains a variety of command formats such as save

parameters, do not save parameters, restart devices, and so on.

3) Can achieve a variety of applications, such as reading the MAC address of

the serial port server, such as changing the working mode of the serial port

server when switching from TCP Server to TCP Client mode, can actively

connect to the server; You can disconnect from the TCP server when

switching from the TCP Client to the TCP Server.

Please refer to “Serial port modification parameters and hardware TCPIP protocol

stack” for detailed operation methods.

16. Remote device management


The so-called remote device management refers to the maintenance and

management of the device through ZLVircom software, including restarting the

68
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

device, modifying parameters and upgrading firmware. This feature is suitable for

users who manage devices through ZLVircom.

For ZLVircom software, the device can be managed remotely as long as it can be

found in the device list. Remote management of equipment can be divided into the

following situations:

1) Automatic search: under the same switch of the device and computer,

whether in the same network segment or not, the method of ZLVircom on the

computer search for devices are: ZLVircomsend broadcast queryAll

devices will reply their parameters to the ZLVircom tool after receiving the

query. This method searches all devices at once.

Figure 53 automatic search

2) Manual add: divided into two cases:

Figure 54 add manually

a) Large routers split the network: in some large networks, the broadcast

packets are split by the router so that the broadcast packets cannot

reach the device, but pinging device IP is enabled. At this point, you

generally need to manually add to solve. The method of manual addition

is to click "manual addition" in the "device management" dialog box to

add the first and last IP to query the devices one by one.

b) Public network server query internal network equipment: the serial server

in the internal network and as a TCP Server mode, zlvircom in the public

network IP server. At this time, a port mapping of 1092 UDP should be

made on the router of the network where the device is located, which is

mapped to the IP of the device. Then, zlvircom will manually add the

69
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

device, and the IP is the public network IP of the device.

3) TCP Client: when the device is a TCP Client, it initiates a TCP connection to

port 4196 of the destination IP (116.15.2.3). When the connection is

established, each hold time automatically sends its own parameter system to

the UDP port (not TCP) on the destination port (4196 in this case,), enabling

zlvircom to search for devices on this computer (116.15.2.3). If the destination

port is not 4196, the default parameter receiving port of zlvircom needs to be

modified by changing the menu/configuration/software configuration/default

listening port, and then starting zlvircom will ignore the execution if TCP port

conflict pops up.

Figure 55 client

4) Timing sending parameters: even if the serial server is in the mode of TCP

server, you can check the "timing sending parameters" function and send

parameters to the destination port of the destination IP (in this case,

116.15.2.3) every 5 minutes. Zlvircom, which receives parameters on this port

of the server, can manage these devices.

70
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

Figure 56 timing sending parameters

To facilitate device identification, give the device an easy-to-remember name if

remote administration is required.

17. Firmware upgrade method


ZLSN7146 can upgrade their own programs, but not each other. Firmware

updates can be applied to devices found in the device list, whether through

automatic search, manual addition, or P2P search.

1) Get the ZLSN7146 firmware file from ZLAN, such as 1.539(7146).bin.

2) In the ZLVircom tool, first search for the device that needs to be upgraded,

and then go to the device parameter edit dialog box. First click "restart

device" once.

Figure 57 upgrade button

After the device is restarted, use the same method to search the device again

and enter the dialog again. Click the "upgrade firmware" button in the lower

right corner of the dialog box.

71
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

Figure 58 upgrade button

3) As shown, select the “program file download” radio option. In the program file,

select the firmware file. The IP address part of the serial port server has been

filled in automatically, no need to write again, and the module type/model has

been selected automatically. Then click download.

Figure 59 Firmware upgrade method of ZLSN2003

4) The download bar starts to move, and the download takes about 30 seconds.

The ACT lights on the device will flash during the download, and the LINK

lights will flash a few times at the end of the download. Then the program

pops up the prompt box of "do not power off the LINK light blinking device

after transmission". Note: this is only after the transmission is completed, it

will take about 3 seconds to write the flash process. At this time, the LINK

light will flash, please don’t power off in the time.

5) Generally after the completion of the download the procedures will

automatically restart, generally without power. See the running indicator light

flashing. If there is no automatic restart, please power on again after the LINK

light flashing stop for more than 30 seconds.

6) Web configuration interface update: after firmware upgrade, the configuration

page inside the module also needs to be updated, otherwise it cannot be

72
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

configured through the Web again, but it does not affect the communication.

Web pages can also be downloaded without a web configuration. To

download the Web, change the "program file" download mode to "Web

directory download" as shown in the figure. And select the root directory

where the local web page is located as the directory where the web files need

to be downloaded (the directory can be obtained from ZLAN), click download,

and download all the files in the local web page directory to the internal file

system of the device.

7) Note:

a) If download under AP mode

b) If the prompt fails, the device will not be damaged. Please restart the

download. In addition, at the end of the download, please do not power

off when the LINK light flashes, otherwise the device will be damaged.

c) Check out the firmware version number of ZLVircom to find out whether

the new firmware has been downloaded successfully.

Figure 60 check firmware version after upgrade

18. Multi-wifi Parameter Configuration


18.1 Usage scenarios

The function of multi-wifi parameter configuration is to enable ZLSN7146 to have

multiple WIFI parameters, such as 3, which can be applied in: STA mode recovery

73
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

to AP, multi-router backup and other occasions.

18.1.1 STA Mode Restored to AP

When the STA mode parameter configuration is wrong, it can be switched

to AP mode, so that the laptop can connect to the wifi module again and

reconfigure.

By default, if the module is used as STA mode, and if the configured SSID

and password are wrong, the router will not be connected. At this time, you

must use reset switch to reset to AP mode or search through the Ethernet

port of the module, and then reconfigure WIFI parameters with the

ZLVircom tool. In some cases, it is not convenient to toggle the reset

switch of the module and connect to the Ethernet port, so the WIFI

parameters are rotated between STAAPSTAAP. When the WIFI

parameters are in AP mode, the user can connect to the module and

reconfigure. The WIFI parameter switch will stop when any WIFI

connection is established. Duration at STA and AP can be set when

switching.

18.1.2 Multi-router Backup

Choose to switch between multiple routers, such as STA1  STA2 

STA3 …  STA1 …. As STA1 is connected to the first router, if not

success, switch to STA2 mode and connect to the second router. This

allows for multiple router backups, and if one of the routers fails to

establish a WIFI connection, you can switch to a second router.

This method allows two routers to be placed on site. When the first router

fails to establish WIFI connection, it can immediately switch to the second

router to realize hot standby.

18.2 Wifi.txt File Format

Wifi.txt is a configuration file whose contents are as follows:

74
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

DEFAULT_WIFI_TIME=10

WIFI_CONFIG_COUNT=2

WIFI_MODE1=STA

WIFI_SSID1=TP-LINK_2312

WIFI_CRYPT1=AUTO

WIFI_KEY1=12345678

WIFI_BRIDGE1=0

WIFI_DHCP1=0

WIFI_TIME1=10

WIFI_MODE2=AP

WIFI_SSID2=TEMP_AP

WIFI_CRYPT2=NONE

WIFI_IP2=192.168.1.200

WIFI_TIME2=10

We assume that the WIFI parameters configured with ZLVircom are

DEFAULT_WIFI parameters, and the WIFI.txt configuration file contains WIFI1

parameters, WIFI2 parameters... WIFIN parameters, etc. After download the

wifi.txt to ZLSN7146, it will circularly switch between DEFAULT_WIFI  WIFI1 

WIFI2  …WIFIN  DEFAULT_WIFI ….

DEFAULT_WIFI_TIME=10 means the amount of time that stay in DEFAULT_WIFI,

in seconds, so here is 10 seconds. WIFI_CONFIG_COUNT=2 indicates how

many wifi parameters are in wifi.txt (DEFAULT_WIFI is not included).

WIFI_MODE1=STA represents the working mode of WIFI1, with a value of STA or

AP.

WIFI_SSID1= tp-link_2312 represents the SSID of the connected router, or its

own SSID name if it is AP mode.

75
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

WIFI_CRYPT1=AUTO indicates the encryption mode, or if there is no password, it

will be NONE. Otherwise, just write AUTO. Other optional WEP64, WEP128, AES,

TKIP are not commonly used.

WIFI_KEY1=12345678 represents the router's wifi password.

WIFI_BRIDGE1=0 indicates whether the network port and wifi are interconnected,

while 0 indicates not. You can ignore this line if you don't care, and the default is

not interconnected.

WIFI_DHCP1=0 indicates whether the DHCP server function is enabled, while 0

indicates not. When this line is not written by default, the DHCP server is turned

on in AP Mode and DHCP server is turned off in STA Mode.

The line WIFI_TIME1=10 cannot be omitted, indicating how long it will be stay if

the WIFI connection cannot be established in WIFI1 mode. Here it is 10 seconds.

WIFI_IP2=192.168.1.200, which means the IP is set to static mode and the IP

address is 192.168.1.200. This is because if the IP is acquired dynamically in the

STA mode, the IP may not be acquired in the AP mode when the router is not

connected, so it must exist as a static IP.

18.3 Download method

The procedure of downloading wifi.txt to ZLSN7146 is to create a new wifi.txt

document in the web page directory. If the user does not have a web directory,

make a new webs directory and then make a separate wifi.txt file.

Figure 61 web directory

76
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

Now click the "upgrade firmware" button in "device configuration", and the web

and firmware download page will pop up:

Figure 62 download of wifi.txt

As shown above, select the web directory to download, then select the web

directory you just created, and then click the "download" button to download

wifi.txt into the device. Above IP, model, space size, port will be automatically filled

in without configuration. Note: any time wifi.txt is updated, the device needs to be

repowered.

18.4 Wifi.txt example

18.4.1 STA mode restored to AP

DEFAULT_WIFI_TIME=120

WIFI_CONFIG_COUNT=1

WIFI_MODE1=AP

WIFI_SSID1=TEMP_AP

WIFI_IP1=192.168.1.200
WIFI_TIME1=300

77
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

When the wifi parameter configured by zlvircom is STA mode, if the

connection fails for 2 minutes, it will switch to AP mode. The hotspot name

is TEMP_AP, and it will stay for 5 minutes. If there is no laptop connection,

it will try to connect in STA mode.

18.4.2 Multi-router Backup

DEFAULT_WIFI_TIME=60

WIFI_CONFIG_COUNT=1

WIFI_MODE1=STA

WIFI_SSID1=TP-LINK_2312

WIFI_CRYPT1=AUTO

WIFI_KEY1=12345678

WIFI_TIME1=60

When the wifi parameter configured by ZLVircom cannot be connected for

1 minute, try to connect to the router of tp-link_2312, and then connect to

the parameter configured by ZLVircom if cannot connect. Do this again

and again until a wifi connection is established.

18.5 Notice

1) If there is no wifi.txt, only the wifi parameter configured by ZLVircom exists,

which is the same as the usage of non wifi.txt. The content of wifi.txt is empty,

just like it does not exist.

2) When the reset switch DEF is on, wifi.txt will not be loaded. If the module is

abnormal due to an abnormal wifi.txt format during debugging, you can set

DEF to the reset position and then download wifi.txt again.

78
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

3) If the wifi connection is established, but the TCP connection cannot be

established, the second wifi parameter will not be switched.

4) Note that after downloading wifi.txt, you need to restart the module before it

can take effect.

5) After upgrading the firmware, wifi.txt will be lost and need to be downloaded

again.

6) Download firmware failure:

a) When there is wifi.txt, there will be wifi switch. At this time, if the firmware

needs to be upgraded, the wifi connection shall be established first,

otherwise the module will be reset constantly, thus the firmware cannot

be upgraded.

b) When switching between various wifi parameters, the IP address of the

device may switch between the IP set in the main interface of the device

and WIFI_IP1. Therefore, if the download fails, the IP of the download

interface may be incorrect. At this time, it is necessary to go back to the

device search interface and search the device again to obtain the current

real IP before downloading.

7) If the STA mode is to automatically fetch IP (IP mode is DHCP),

DEFAULT_WIFI_TIME needs to be reduced appropriately. The reason is that

the IP cannot be obtained without wifi connection, but the IP will be tried for

about 1 minute before the timing starts, so DEFAULT_WIFI_TIME should be

60 less than the usual value, but not 0.

8) When ZLSN7146 switches from the default STA parameter of

DEFAULT_WIFI to the AP parameter of WIFI1, the wifi parameter seen on the

web interface is WIFI1 (although the DEFAULT_WIFI parameter is seen from

zlvircom). If you need to modify wifi parameters through the web, you need to

modify all wifi parameters, including STA/AP, SSID, password and encryption

79
Shanghai ZLAN Information Technology Co., Ltd Tel: +86-17321037177 http://www.zlmcu.com

mode.

19. Order information


Model Function

ZLAN7146 2.4G

ZLAN7146-5 2.4G/5G

ZLAN7146N 2.4G P2P

ZLAN7146N-5 2.4G/5G, P2P

20. After-Service
Shanghai ZLAN Information Technology Co., Ltd.

Address: 12 floor, D building, No. 80 CaoBao road, Xuhui District, Shanghai, China

Phone: 021-64325189

Fax: 021-64325200

Web: http://www.zlmcu.com

Email: [email protected]

80

You might also like