关注官方微信

中文.

Products

Products

Serial Port to TCP/IP Solution Selection

Date:2010-11-04 Author:Shanghai ZLAN View:6275

This document focuses on guiding users to complete solution selection of serial to TCP/IP from the system overall scheme (such as hardware selection, software selection, etc.). If it is the choice of product model, please refer to the《Serial Port to Ethernet Products Selection Guide》。

1. Finished Products and Embedded Modules

The finished product is commonly referred to as the serial device server, and the embedded module is called the serial port to TCP/IP module.

Choose the embedded module that can plug the circuit board of a similar DIP chip to the user circuit boards, connect the 4 pins to Ethernet port RJ45, and the other 2 pins connect to the UART pin of user MCU serial port, so that can realize the network upgrade of user system. This solution makes the user system better in overall, and the embedded module is much lower than the finished product. If the user designs the device or network transformation of the serial device, the scheme can be used.

If the user uses the project, some of the serial port devices that are purchased need to be connected to the Internet, so the embedded modules are not suitable, so you can use the serial device server such as ZLAN5102/5103.

2. Virtual serial port, Socket programming, DLL library, Modbus TCP

The serial to TCP/IP converter is used to solve the conversion of serial port RS232/485/422 to the Ethernet port, and then how the user software communicates with the converter after converting to the Ethernet port. There are four software schemes for ZLAN converter: virtual serial port, Socket programming, DLL library and Modbus TCP.

Virtual serial port, is the user no needs to modify the original software after using TCP/IP serial converter (serial port device should have a software run on the computer and communicate with the device), using ZLAN ZLVircom program can create virtual serial port similar like COM5, COM6, and then bind the COM5, COM6 with the converter through software. Then, the user software open COM5, COM6, use them just like the original hardware serial port as COM1. Using a virtual serial port for users already having the serial port software can be considered. But for the users haven’t designed software, it is recommended to use socket programming, as the socket programming is more efficient than the virtual serial port, no need to install the driver.

Socket programming is to use the development environment on operating system like Windows/Linux to develop network program, then can directly communicate with TCP/IP converter. Since the ZLSN module or ZLAN converter is compliant with the standard TCP IP protocol, it communicates with the network programming software of any socket interface. The protocol is transparent transmission, which is what the network sends, the serial port receives and vice versa. The user can choose Socket programming provided by development environment such as VC, VB, Delphi, C# and so on, for example to connect the converter in server mode is to call the Connect function, parameter is the IP and port of the converter.

Using DLL, the DLL provided by ZLAN is a dynamic link library that uses Socket programming encapsulation to operate the ZLSN module. Users can use DLL to implement search, parameter setting and communication function of ZLSN module. Compared with Socket programming, DLL is more powerful and easier to call. But for those familiar with network programming, users still want to use Socket programming, and don't want their own software with a bunch of DLLS.

Modbus TCP, is the standard Modbus TCP protocol software the user use, ZLAN ZLSN2040 of serial port to TCP/IP can directly convert the Modbus TCP data flow of the Ethernet port to Modbus RTU data flow, in the converter serial port it can communicate with user serial device via Modbus RTU mode. The converter can be used as Modbus Gateway to realize the standard Modbus TCP software access standard Modbus RTU device.

3. LAN Application or Internet Application

If the user system does not cross the Internet and is only monitored within the LAN, it is simpler. Of course, if you need to cross Internet the ZLAN ZLSN series modules and ZLAN serial device server also can be available, because it supports accessing to the host via domain name, and across the Internet application may also need to set up DDNS and NAT router mapping. The specific can consult the ZLAN engineer.