-
Notifications
You must be signed in to change notification settings - Fork 418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Network Stream #77
Comments
You can poll any register every n seconds, where n < disconnection timeout |
Polling register is a hack & i do check the connection before trying write. The connection status is true. |
Polling a register is not a hack. |
Or |
: Issue with polling register is, user have to define the register which is available in the slave to poll always. |
Well, if you plan to connect via modbus to a slave, you should at least be aware of one or more register addresses actually available on that slave. Don't you think? |
Terrible idea in the class definition. You can do it though in your implementation. |
Hi, To elaborate further, say i have prepared a modbus master tool using the library. I can connect it to multiple slave for testing/data collection. Each slave may not have the same address as other, in this case a additional lookup for defining the keep alive registers need to be taken care. I was just looking a way out to avoid this. |
The issue here, IMHO, is that you have a timing-out slave problem, that you'd like to solve on the master. |
Probably the best to do i guess. 👌🏻 |
If connected with TCP/IP, the connection aborted if there is no poll for sometime with server. It end up with below exception:
At this line:
stream.Write(data, 0, data.Length-2);
System.Net.Sockets.SocketException : Unable to read data from the transport connection: An established connection was aborted by the software in your host machine.
Is there anyway to keep the connection live even there is no poll until disconnected from slave.
The text was updated successfully, but these errors were encountered: