문제

We are using Jamod RTU for capturing raedings of variuos electric meters connected serially. We have set modbus timeoutexception = 1200ms. Now what is happening, when we are pinging one meter and we dont get the result (or reading), we move to next one connected in the same series. But sometimes, the previous meter sends the reading back to the application and the reading of that meter is save for the new or the next one.

To solve this issue, we have reduced network timeout in nport administrator (for managing com ports) from 5000 to 500 ms. But I dont think that is the permanent solution. Is there any way to avoid that late coming message or mark every message with its corrosponding meter?

도움이 되었습니까?

해결책

Each MODBUS reply has device source address embedded inside the message. Reading it solves your problem.

다른 팁

From page 10 of Modicon Modbus Protocol Reference Guide PI–MBUS–300 Rev. J

How the Address Field is Handled

The address field of a message frame contains two characters (ASCII) or eight bits (RTU). Valid slave device addresses are in the range of 0 – 247 decimal. The individual slave devices are assigned addresses in the range of 1 – 247. A master addresses a slave by placing the slave address in the address field of the message. When the slave sends its response, it places its own address in this address field of the response to let the master know which slave is responding.

Address 0 is used for the broadcast address, which all slave devices recognize. When Modbus protocol is used on higher level networks, broadcasts may not be allowed or may be replaced by other methods. For example, Modbus Plus uses a shared global database that can be updated with each token rotation.

So you can keep track of the slave addresses and assign values on receive by the specified slave address. This should be accessible from getUnitID() on all response objects.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top