I got some problems while testing a client/server application using the Snap7 C++ API on linux. After constinously reading a small set of DBs between two different machines, the values returned turned to be totally messed, e.g. values belonging to DB 1 were shown as part of DB 3.
At first this problem happened twice only. After reading about some people reporting problems on disconnections here in the forum and a bit of testing I found out that everytime there is a conection link loss the client started to mess read data and turning back to normal operation only after a connection restart.
The root cause is the retransmission of reading requests sent while the link is down. Beside these reading requests generate a ETIMEDOUT error they remain in the TCP buffer and are transmitted as soon as the link is up again.
As a workaround I inserted a call to Purge() in the function isoExchangeBuffer to assure the TCP buffer is empty before executing a reading operation.
Best regards
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry for the delayed response. I just putted the Purge function in the begining of this function. In all my tests the problem not happened again but as I mentioned it was not a definitive solution to the problem.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, I am facing similar issue in python using the snap7.dll
I am seeing lots of TCP Retransmission and TCP OUT OF Order in Wireshark after a few minutes of S7 read request sent from an Embedded system. It responds to all the requests fine for a few minutes and then starts to show Retransmission very frequently.
Any help is appreciated.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
after digging around in the forum, I have found the following solution: https://sourceforge.net/p/snap7/discussion/bugfix/thread/de352e4cc2/
I have modified Snap7 in this way and after that, the error no longer occured.
Thanks to Felipe and Rousseau for their workarounds.
Maybe this should find it's way in the official version?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I got some problems while testing a client/server application using the Snap7 C++ API on linux. After constinously reading a small set of DBs between two different machines, the values returned turned to be totally messed, e.g. values belonging to DB 1 were shown as part of DB 3.
At first this problem happened twice only. After reading about some people reporting problems on disconnections here in the forum and a bit of testing I found out that everytime there is a conection link loss the client started to mess read data and turning back to normal operation only after a connection restart.
The root cause is the retransmission of reading requests sent while the link is down. Beside these reading requests generate a ETIMEDOUT error they remain in the TCP buffer and are transmitted as soon as the link is up again.
As a workaround I inserted a call to Purge() in the function isoExchangeBuffer to assure the TCP buffer is empty before executing a reading operation.
Best regards
Hi,
I am facing the same problem. Where exactly did you place the Purge() call? Did this fix the error for you?
Thanks in advance!
Sorry for the delayed response. I just putted the Purge function in the begining of this function. In all my tests the problem not happened again but as I mentioned it was not a definitive solution to the problem.
Do I have to include any headers? Where this purge function is defined?
The Purge fucntion is defined in sys/snap_msgsock.h. But it is already included in the s7_isotcp.h header file.
Hi, I am facing similar issue in python using the snap7.dll
I am seeing lots of TCP Retransmission and TCP OUT OF Order in Wireshark after a few minutes of S7 read request sent from an Embedded system. It responds to all the requests fine for a few minutes and then starts to show Retransmission very frequently.
Any help is appreciated.
Hi,
after digging around in the forum, I have found the following solution:
https://sourceforge.net/p/snap7/discussion/bugfix/thread/de352e4cc2/
I have modified Snap7 in this way and after that, the error no longer occured.
Thanks to Felipe and Rousseau for their workarounds.
Maybe this should find it's way in the official version?