RS232 to network port flow control function introduced

1.RS232 to network port flow control

RS232 to network port converter ZLAN2100 is a high performance converter supporting RS232 flow control and network port flow control. The so-called flow control is to control the speed of the data flow to prevent the sender from continuing to send data to cause data loss when the receiver buffer is full. Flow control in the RS232 to Ethernet port is very important to prevent packet loss.

RS232 and network ports use different flow control mechanisms. RS232 flow control is divided into no flow control, software flow control, hardware flow control. The flow control of the network port generally adopts TCP's window flow control mechanism. Due to the difference in the two flow control methods, the ZLAN2100 must convert the RS232 protocol data into network protocol data, and also perform flow control conversion.

RS232 to network port

Figure 1. RS232 to Ethernet Converter - ZLAN2100

The RS232 flow control mode is described as follows:

No flow control: no flow control function. Software flow control: Software flow control is also called XON/XOFF flow control and is implemented using control characters XON and XOFF. In the RS232 data communication process, if the sender receives the XOFF character, it stops sending the data, and if it receives the XON character, it resumes sending the data. XON is generally defined as hexadecimal 0x11 and XOFF is hexadecimal 0x13. Hardware flow control: Hardware flow control is further divided into DSR/DTR flow control and CTS/RTS flow control. The hardware flow control informs the sender through the level of the hardware. The receiver's buffer is almost full. For CTS/RTS flow control, RS232 (DB9) has 8 pins for RTS and 7 pins for CTS. In DSR/DTR flow control, RS232 (DB9) has 6 pins for DSR and 4 pins for DTR.

Network port flow control mode: The network port generally adopts two protocols: TCP protocol and UDP protocol. The UDP protocol does not have flow control. The TCP protocol uses window flow control. That is, the sender knows the size of the receiver's receive buffer, and the sender does not send more data than the receiver's receive capacity. The receiver also periodically sends the data. Changes in the size of the square window.

The ZLAN2100 and ZLVircom cooperate to realize the flow control conversion of the RS232 to Ethernet port. For example, when the RS232 gives the hardware flow control pin high level (the high level indicates the start of flow control), the ZLAN2100's embedded TCP/IP protocol stack automatically informs the TCP. The window is reduced; otherwise the ZLAN2100 automatically sets the hardware flow control pin high to high when the TCP window is reduced.

2. RS232 serial line and hardware flow control

RS232 serial cable connector is divided into male and wood. In addition, some RS232 serial lines are 9-core, and some have only 3 cores: GND, RXD, and TXD. Some RS232 serial lines are crossed by 2, 3 (ie, RXD, TXD cross), and some are not crossed. To implement RS232 hardware flow control must use 9-line RS232 serial cable, or hardware flow control signal can not be passed in the past.

3. Manually set RS232 to network port flow control mode

Users can manually set the ZLAN2100's flow control method according to actual needs. The method is to enter the device management of the ZLVircom main interface -> edit the device for a specific device -> enter the device setting dialog box -> select the serial flow control parameter.

4. Flow control of RS232 to Ethernet port

In addition to manually setting the flow control mode, when the virtual serial port is used, in order to realize the automatic detection of the flow control mode used by the ZLVircom software for the user software, the flow control adaptation must be enabled. The method is enabled: enter zlvircom menu -> "configuration" -> "software configuration", pop-up "vircom configuration" dialog box, will "select the parameters you need to use" in the "flow control" tick, by default The "flow control" adaptation function is not ticked.

Vircom configuration

Figure 2. Flow control configuration for vircom

5. Manual control hardware flow control of RS232 to Ethernet port

In the computer's RS232 (COM port) programming, if the user invokes the underlying RTSEnalbe() function of the operating system (such as the Windows VC++ environment), the level of the RTS pin can be controlled manually, allowing it to output 1 or 0 at any time. This function can actually be used as IO port DOUT, that is to use this function to directly control an IO output pin. Then, after using Zhuo Yu's ZLVircom virtual serial port driver, the user opens the virtual serial port COM5. Similarly, RTSEnalbe() can be used to control the RTS level of the RS232 port of the ZLAN2100 remote port. This feature is a more advanced feature. For details, refer to: http://?h

Angle Grinder

Power Tools,Angle Grinder,Hand Tools

Fenghua Jade Motor Co., Ltd. , http://www.goselectric.com