关注官方微信

中文.

Products

Products

Multi-host access to 645 meters

Published Time:2019-09-03 Author:Shanghai ZLAN Views:8156

645 97 protocol is a national standard communication protocol used by electricity meters, which is widely used. General through RS485 bus read the current power, current voltage, this month's electric quantity and other data. But due to the RS485 bus principle limit, two hosts can not read the meter at the same time. However, in the field of energy monitoring, it is often necessary to have multiple computers and screens to obtain the data of electricity meters.

Common "transparent transmission" RS485 to TCP/IP products cannot be used here, here is how to introduce ZLAN5143 multi-host function to solve this problem.

ZLAN5143的多主机功能

As shown in the figure, the multi-host function of ZLAN5143 will schedule the RS485 bus. When host 1 and host 2 need to use the bus at the same time, ZLAN5143 will play the role of "referee", prohibit simultaneous preemption, and reasonably schedule the use time of the bus, so as to achieve the effect of "multi-host" smooth simultaneous access. Multiple hosts can also make the returned data from host 1 query not be sent to host 2, causing data interference.

It should be pointed out that Modbus gateways generally have the functions of automatically querying and storing register contents, so as to solve the conflict problem of multi-host access. However, such Modbus gateways are powerless for RS485 protocol (such as 645 protocol) of non-Modbus RTU. However, 5143 can also be applied to multi-host implementations of non-Modbus RTU types.

First, let's test what happens when you don't have multiple hosts enabled, but in a normal "passthrough" mode:

We use two SocketDlgTest tools to connect to 5143, constantly sending 645 protocol instructions 68 50 00 00 00 00 00 00 01 02 46 C7 30 16 at the same time, as shown in the figure, which was originally: 68 50 00 00 00 00 00 68 81 06 46 C7 53 35 34 33 A3 16 instruction conflict into 68 50 00 00 00 00 00 00 68 81 06 C6. That's missing and error. In addition, when only one SocketDlgTest is sent, two SocketDlgTest Windows will receive data when the data is returned, which does not meet the requirements. The window should not send data and not receive any return.

Now turn on "Multi-host Function", keep "transformation Protocol" to "none" when configuring 5143, and click "More Advanced Options...", set as follows.

Since the serial port here is 1200bps, the timeout is set to 1000. Go back to Device Settings and click Modify Settings. After the above experiment, it was found that no matter how to send at the same time, the correct data would be obtained. And SocketDlgTest window that does not send will not receive data. It has realized the anti-conflict and independent communication. In addition, combined with ZLvricom's virtual serial port, the original serial port software can be used to communicate between the two hosts.

In conclusion, "multi-host function" provides an effective scheme for multi-host access of RS485 instruments of various non-Modbus RTU.