Author Topic: ModbusTCP_ConnectionEstablished event handler  (Read 1586 times)

MrPike

  • Sr. Member
  • ****
  • Posts: 297
    • View Profile
ModbusTCP_ConnectionEstablished event handler
« on: October 20, 2015, 04:46:40 PM »
Is the event handler for the ModbusTCP_ConnectionEstablished  able to be used?  I am trying to create an indication that a device is connected using this code but when I use ModRsim, I do not get any response from the BasicIndicator.  Does anyone have code to show how to implement this?  Thank you

   Private Sub ModbusTCPCom1_ConnectionEstablished(sender As Object, e As EventArgs) Handles ModbusTCPCom1.ConnectionEstablished

        BasicIndicator1.SelectColor2 = True
    End Sub

    Private Sub ModbusTCPCom1_ComError(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles ModbusTCPCom1.ComError
        'BasicIndicator1.SelectColor3 = True
    End Sub

 

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: ModbusTCP_ConnectionEstablished event handler
« Reply #1 on: October 20, 2015, 07:15:38 PM »
Unfortunately these events do not seem to work in the current release. I tested it in the upcoming version and they do work.

MrPike

  • Sr. Member
  • ****
  • Posts: 297
    • View Profile
Re: ModbusTCP_ConnectionEstablished event handler
« Reply #2 on: October 20, 2015, 10:55:52 PM »
Ok, I will look forward to this in the next release.  In the meantime, I'm using the DataReturned event to show good communications.  The problem is when comms is lost, the data changed event is still fired.  How can I effectively show a loss of comms?