From the SNAP7 manual: When we call CliConnectTo(), or when an active Snap7Partner needs to connect,
first the PLC is “pinged”, then, if the ping result was ok, the TCP connection is
performed.
What I experience is that ConnectTo() tries 5 times without noticable delay (probably due to pinging?), but after that my program freezes about 5s while the 6th connect is in progress. I do all communications from the main thread using callbacks to get notified if a job is finished. It works very well but if I unplug (one of the) PLC(s) my program freezes while reconnect is in progress. I am using D2007...
Best regards,
Bert Kortenbach
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Some more info:
The first 5 tries return errorcode:10065 "Unreachable peer"
The 6th try returns error 10060 "Connection timed out"
After the 6th try everything starts again from the beginning i.e. 5 quick errors 10065 1 slow error 10060
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This sounds strange to me, there is any code into snap7 client that makes 5 pings under Windows.
We currently use Snap7 in all our plants and, when the PLC is reachable Snap7 connects, otherwise it doesn't try the connection.
The network connection between the PC and the PLC is direct or there are managed routers/NAT/Gateways in the middle ?
Can you provide a Wireshark dissection ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi All,
From the SNAP7 manual:
When we call CliConnectTo(), or when an active Snap7Partner needs to connect,
first the PLC is “pinged”, then, if the ping result was ok, the TCP connection is
performed.
What I experience is that ConnectTo() tries 5 times without noticable delay (probably due to pinging?), but after that my program freezes about 5s while the 6th connect is in progress. I do all communications from the main thread using callbacks to get notified if a job is finished. It works very well but if I unplug (one of the) PLC(s) my program freezes while reconnect is in progress. I am using D2007...
Best regards,
Bert Kortenbach
Some more info:
The first 5 tries return errorcode:10065 "Unreachable peer"
The 6th try returns error 10060 "Connection timed out"
After the 6th try everything starts again from the beginning i.e. 5 quick errors 10065 1 slow error 10060
This sounds strange to me, there is any code into snap7 client that makes 5 pings under Windows.
We currently use Snap7 in all our plants and, when the PLC is reachable Snap7 connects, otherwise it doesn't try the connection.
The network connection between the PC and the PLC is direct or there are managed routers/NAT/Gateways in the middle ?
Can you provide a Wireshark dissection ?