Author Topic: Execute code when Ethernet TCP/IP connection closed  (Read 1271 times)

qwideman

  • Newbie
  • *
  • Posts: 41
    • View Profile
Execute code when Ethernet TCP/IP connection closed
« on: June 12, 2014, 09:51:17 AM »
I'd like to run a subroutine whenever my PLC connection causes an error. I'm using Modbus TCP/IP.

I have tried:
 
Sub Comm_error(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ModbusTcpCom.ComError
Msgbox...etc
End Sub

This does not execute, even if I set ModbusTcpComm to an address other than my PLC.


How should I be doing this?

Quinton
Rolan Inc.