Author Topic: How to make an item be invisible if no communication with PLC  (Read 1406 times)

mr14

  • Newbie
  • *
  • Posts: 12
    • View Profile
Hi

How can I set an item to be invisible if the is no communication with the PLC it is related to?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: How to make an item be invisible if no communication with PLC
« Reply #1 on: May 29, 2017, 09:00:06 AM »
What driver are you using?

mr14

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: How to make an item be invisible if no communication with PLC
« Reply #2 on: May 29, 2017, 09:09:17 AM »
MODBUS_TCP

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: How to make an item be invisible if no communication with PLC
« Reply #3 on: May 29, 2017, 09:22:03 AM »
See if this works:

   Private Sub ModbusTCPCom1_ConnectionEstablished(sender As Object, e As EventArgs) Handles ModbusTCPCom1.ConnectionEstablished
         Label1.Visible = True
    End Sub

    Private Sub ModbusTCPCom1_ComError(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles ModbusTCPCom1.ComError
        Label1.Visible = False
    End Sub

mr14

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: How to make an item be invisible if no communication with PLC
« Reply #4 on: June 01, 2017, 02:36:06 AM »
Ok, it is working but for some reason t doesn't work on the main form.
What could be the reason?
« Last Edit: June 01, 2017, 03:14:38 AM by mr14 »