利来囯际W66

关注官方微信

中文.

RS232 to Ethernet Hardware Flow Control Configuration Guide

Date:2011-10-14 Author:Shanghai ZLAN Views:4266
1. Flow control of RS232 to Ethernet Port

The RS232 to Ethernet port converter ZLAN5103 is a high performance converter which supports RS232 flow control and Ethernet port flow control. The flow control is to control the speed of the data flow and prevent the sender from sending the data when the receiver buffer is full. It is very important to prevent packet loss in RS232 to Ethernet port.

RS232 and the Ethernet port adopt different flow control mechanism. The flow control of RS232 is divided into no-flow control, software flow control and hardware flow control. The flow control of Ethernet port generally adopts the window flow control mechanism of TCP. Because of the differences between the two types of flow control, ZLAN5103 also has to change the flow control method when converting the RS232 protocol data into the Ethernet port protocol data.

The flow control mode of RS232 is described as follows:
1). No flow control: no flow control function.
2). Software flow control: the software flow control is also called the XON/XOFF flow control, which is realized by using the control character XON and XOFF. In the RS232 data communication process, if the sender receives the XOFF character, it stops sending the data, whereas if it receives the XON character, it starts sending the data again. XON is generally defined as hexadecimal 0x11, XOFF is hexadecimal 0x13.
3). Hardware flow control: hardware flow control is divided into DSR/DTR flow control and CTS/RTS flow control. The hardware flow control is to notify the sender through the high and low level of the hardware, and the receiver's buffer is nearly full. When CTS/RTS flow control, the 8th pin of RS232 (DB9) is RTS and 7th pin is CTS. When DSR/DTR flow control, the 6th pin of RS232 (DB9) is DSR, and the 4th pin is DTR.
4). Ethernet port flow control mode: the Ethernet port generally adopts two protocols, TCP and UDP. The UDP protocol is no flow control, TCP uses the window flow control, namely the sender know the receiving buffer size of receiver, the sender will not send the amount of data in excess for the receiver to receive, the receiver will also tell the sender window size changes on a regular basis.

ZLAN5103 and ZLVircom cooperate with each other to realize the flow control of RS232 to Ethernet port, such as when RS232 give hardware flow control pin high levels (high level means begin to flow control), the embedded TCP/IP protocol stack of ZLAN5103 automatically inform the TCP window to reduce; On the contrary, when the TCP window is reduced, ZLAN5103 automatically sets the hardware flow control pin height to high level.

2. RS232 Serial Port Line and Hardware Flow Control

The joint of RS232 serial line is divided into male head and female head. In addition, some RS232 serial lines are 9 cores, and some only have 3 cores of GND, RXD and TXD. Some RS232 serial lines are 2, 3 intersecting (that is, RXD, TXD cross), and some of them are uncrossed. To realize RS232 hardware flow control must use the RS232 serial line of 9 lines, otherwise the hardware flow control signal cannot pass.

3. Manually Set the flow control of RS232 to Ethernet port

Users can manually set the flow control mode of ZLAN5103 according to the actual needs, setting method is to enter ZLVircom main interface: Device Manage -> choose the device to enter “Edit Device” -> enter “Device Settings” dialog -> choose the serial flow control parameter.

4. The flow control self-adaptive of RS232 to Ethernet port

In addition to manually setting the flow control mode, in order to realize the automatic detection of the flow control mode adopted by ZLVircom software to the user software in the use of virtual serial port, the flow control self-adaption must be enabled. The enable method is: enter ZLVircom menu - > "config" - > "software setting" pops-up "Vircom Setting” dialog box, select the “Flow Control” on “Serial parameters need On-The-Fly”, by default " Flow Control " self-adaptive is not selected.

5. Manual control hardware flow control of RS232 rotary screen.

In RS232 (COM) programming of computer, the user can invoke the RTSEnalbe () function at the bottom of the operating system (such as VC++ environment of Windows) to manually control level of the RTS pin, let its output 1 or 0 at any time. This function can actually be used as an IO port DOUT, which directly controls an IO output pin. Then, after the ZLVircom virtual serial port is driven, the user opens the virtual serial port COM5, which can also control the RTS level of RS232 port of ZLAN5103 at the remote end of Ethernet port via RTSEnalbe(). This feature is a more advanced feature.

利来囯际W66