Author Topic: Periodic TCP Port Closure  (Read 13830 times)

BC SYSTEMS

  • Full Member
  • Posts: 146
    • View Profile
Periodic TCP Port Closure
« on: October 01, 2013, 08:10:47 AM »
Hi,

I'm looking to eliminate some communication errors we seeing on site.  The PLC's are connected via Wi-Fi gateways and sometimes the SCADA HMI looses connection and doesn't always re-connect.

I'm not sure if the PLC or the SCADA are to blame or if the Wi-Fi gateways are adding latency which is upsetting things.

So, to try and solve the issue via the process of elimination,  I'm would like to add a small function to close all tcp traffic and if need be restart the PLC, I was looking at setsystem 251 but this only works on FW78 +PLC's.  Some of the PLC's I have are FW76, 77 & 78.  I like to keep my code consistent in all the PLC's so was looking for some advice.

I could periodically call a reset function but I'm not sure if this will close the TCP sockets, does PRINT #4 "</>" close incoming connections?

Cheers

Marcus

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Periodic TCP Port Closure
« Reply #1 on: October 01, 2013, 10:35:22 AM »
PRINT #4 "</>" only closes the client connection the PLC itself makes to a remote server. It has no effect on the incoming connections to its server from other clients.

RESET command does not close the incoming connection. REBOOT command on the other hand will reset everything and closes all open or half open connection.

You could set up the HMI to periodically set the present value of a timer to a certain value (e.g. set TIMERPV[1]  = 150 means 15 seconds). So as long as the HMI has a connection to the PLC the timer will never time out since its present value is being altered by the HMI.

But when the HMI loses connection with the PLC the timers will count down to zero and you can then trigger a custom function to perform an orderly reboot of the PLC.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

BC SYSTEMS

  • Full Member
  • Posts: 146
    • View Profile
Re:Periodic TCP Port Closure
« Reply #2 on: October 01, 2013, 01:44:44 PM »
Hi,

Thanks for the suggestion, I will implement that function in the HMI and see how I get on.

Can you confirm the reboot works on FW 76?

Cheers

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Periodic TCP Port Closure
« Reply #3 on: October 01, 2013, 04:00:26 PM »
Yes, reboot command should work on r76 firmware.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS