Skip to content
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 Failure #70

Closed
GoogleCodeExporter opened this issue Oct 2, 2015 · 1 comment
Closed

Network Failure #70

GoogleCodeExporter opened this issue Oct 2, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

Hi! I need to reconnect some modbus devices after network failure.
To do this, i tried to follow the steps below: 
1. Check ping to devices (they are PLCs)
2. Create a new instance of a TcpClient object
3. Create a new ModbusIpMaster object using the ModbusIpMaster.CreateIp(client) 
method
4. Add that object to a List of ModbusIpMaster

at the first connection, if Pings are successful, have no problem to write/read 
on shared memory area.

After a network failure (the network cable is unplugged), i restored the 
connection and i tried to clear the list of ModbusIpMaster and follow the steps 
from 1 to 4, but now if i try to read/write i get an InvalidOperationException.

How can i re-initialize the connection to modbus devices, and restart 
reading/writing on modbus?


Thanks


Original issue reported on code.google.com by camnaghi...@gmail.com on 23 Apr 2014 at 2:13

@GoogleCodeExporter
Copy link
Author

I resolved the issue.

At ping failure i follow the steps below:
1. Close all TCP connections to Modbus Devices.
2. Dispose all ModbusIpMaster objects


At next ping success you can reconnect following the steps in previous post :)

Original comment by camnaghi...@gmail.com on 30 Apr 2014 at 8:22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants