利来囯际W66

关注官方微信

中文.

RS485 Multi-host Solution

Published Time: 2013-05-22 Author: Shanghai ZLAN Views: 3374
1. Multi-host problem of RS485.

The RS485 is a single-duplex bus, and to prevent competition on the bus, there is usually only one host, and use the type of one time host query one time slave answer. But sometimes, we do need multiple hosts to monitor multiple RS485 devices, such as requiring two computers to monitor the same few RS485 devices, and best to share the RS485 bus.

This problem is often encountered in practice, but it is not well solved. The difficulty is that the two hosts are completely independent, so they have no coordination mechanism, and if the two hosts simultaneously interrogate the slave device, the data conflicts on the RS485 bus must be caused.

2. ZLAN RS485 multi-host solution

Because of the problem of the RS485 bus itself, the above conflict problem cannot be solved with RS485. The RS485 signal can be converted to a network (TCP/IP) signal using the ZLAN5142 converter (as shown in the above converter 1). Because the network signal itself can handle the concurrency, it can solve the conflict problem of RS485 bus well.

Though the slave device end is still the RS485, but there is no relationship, because ZLAN5142 can queue the data of which the multiple hosts receive, data can be temporarily cached inside ZLAN5142, not output from the serial port to the RS485 at the same time. ZLAN5142 supports 10 TCP connection accesses temporary.

The data caching capability of ZLAN5142 is the key factor to solve the above problem of RS485 multi-host, but that is not able to completely solve the problem, this is because many host also involves more complex customized queuing mechanism for specific agreement waiting time. It is also said ordinary serial to Ethernet switch is not possible to achieve the multi-host RS485 function, as ZLAN ordinary ZLAN5102 also does not have this feature, RS485 multi-host must choose the ZLAN5142 mode with certain RS485 multi-host customized program.

If the host is a computer, then the method to realize are basically three ways: (1) the user change the original serial port communication mode of opening the COM to TCP/IP network communication mode, based on the socket network programming. (2) change the original Modbus RTU protocol based on RS485 to Modbus TCP, because ZLAN5142 has Modbub TCP to RTU function. When using this method, select "Modbus TCP to RTU" in the conversion protocol section. (3) the fastest way is to use virtual serial port on multiple hosts so that the original serial port software can be used without modification.

If the host is RS485 device, then first use ZLAN5102 to convert the multi-host RS485 port to network, and next connected to ZLAN5142. For the method of pair-connecting multiple ZLAN5102 and ZLAN5142, you can refer to here. If multiple serial ports are close, you can also use multi-port serial device server ZLAN5400 instead of multiple ZLAN5102.

利来囯际W66