Author Topic: Testing Connection on form  (Read 2023 times)

Jesse

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
Testing Connection on form
« on: December 17, 2013, 07:36:29 PM »
So I'm using 1 driver to communicate with several IPs by just changing IP in the code and its working just fine but theres one problem. When I change the IP to a plc thats not even connected and try to send info to it there are no errors thrown. This could be a problem if an operator ever sends info to a PLC thats not connected. I'm using a CLXIP driver, is there a way that when I change IP address it will test if its successfully communicating?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Testing Connection on form
« Reply #1 on: December 18, 2013, 06:44:07 AM »
On the CLX driver there is a ConnectionEstablished event that you can handle to know when it has connection to the PLC.

bachphi

  • Hero Member
  • *****
  • Posts: 671
    • View Profile
Re: Testing Connection on form
« Reply #2 on: August 10, 2016, 08:46:30 AM »
In the form load, I put PLC.ReadClock().  This force ConnectionEstablished event to fire and inside this event , I set PLCIsConnected = True and use this boolean throughout the program. The PLC.ReadClock need to be in the try catch statement.
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================