plcpeople / nodeS7

Node.JS library for communication to Siemens S7 PLCs
MIT License
356 stars 120 forks source link

Tries to connect to a PLC with wrong IP address, never returns error, always tries to reconnect #140

Open mervoli opened 11 months ago

mervoli commented 11 months ago

When I try to connect to a PLC with a wrong IP adrress, the connect function never returns error, always tries to reconnect. After a timeout value, it should return error. You can see the output logs:

[129765,204918200 141.29.126.95 S1] Connection cleanup is happening [129765,209942300 141.29.126.95 S1] Attempting to connect to host... [129765,221514200 141.29.126.95 S1] TCP Connection Established to 141.29.126.95 on port 102 [129765,221787200 141.29.126.95 S1] Will attempt ISO-on-TCP connection [129765,222156100 141.29.126.95 S1] Using rack [0] and slot [1] [129766,723510400 141.29.126.95 S1] TIMED OUT connecting to the PLC - Disconnecting [129766,723684100 141.29.126.95 S1] Wait for 2 seconds then try again. [129766,723910100 141.29.126.95 S1] ConnectionReset has been called to set the reset as pending [129766,724229100 141.29.126.95 S1] Scheduling a reconnect from packetTimeout, connect type [129768,724961200 141.29.126.95 S1] The scheduled reconnect from packetTimeout, connect type, is happening now [129768,725280000 141.29.126.95 S1] Connection cleanup is happening [129768,726857500 141.29.126.95 S1] Attempting to connect to host... [129768,732321300 141.29.126.95 S1] TCP Connection Established to 141.29.126.95 on port 102 [129768,732491300 141.29.126.95 S1] Will attempt ISO-on-TCP connection [129768,732659800 141.29.126.95 S1] Using rack [0] and slot [1] [129770,224930400 141.29.126.95 S1] Timed reset has happened. Ideally this would never be called as reset should be completed when done r/w. [129770,225583700 141.29.126.95 S1] ResetNOW is happening [129770,225697400 141.29.126.95 S1] Clearing an earlier scheduled reset [129770,232768400 141.29.126.95 S1] TIMED OUT connecting to the PLC - Disconnecting [129770,232993100 141.29.126.95 S1] Wait for 2 seconds then try again. [129770,233135600 141.29.126.95 S1] ConnectionReset has been called to set the reset as pending [129770,233282900 141.29.126.95 S1] Scheduling a reconnect from packetTimeout, connect type [129772,234204200 141.29.126.95 S1] The scheduled reconnect from packetTimeout, connect type, is happening now [129772,234426600 141.29.126.95 S1] Connection cleanup is happening [129772,234988200 141.29.126.95 S1] Attempting to connect to host...

Thank you in advance,