Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Ivy

Pages: [1]
1
Support Questions / Setting timeout for EthernetIPforSLCMicroCom driver
« on: November 12, 2015, 09:21:17 AM »
Hi !

I'm using c# language and I would like to try to set some timeout for throwing an exception in case when for example someone unplug my ethernet cable to Allen-Bradley SLC505 PLC. Is it possible to do so in Adv HMI API ? How can I achieve that ?

For now I have this :
 
Code: [Select]
using AdvancedHMIDrivers;
using MfgControl.AdvancedHMI.Drivers;

static EthernetIPforSLCMicroCom plc;

static void Main(string[] args)
        {
            plc = new EthernetIPforSLCMicroCom();
            plc.IPAddress = "192.168.1.52";
            string readValue;

try
                {
                    readValue = plc.Read("N241:000/15");
                    Console.WriteLine(readValue);
                }
                catch (MfgControl.AdvancedHMI.Drivers.Common.PLCDriverException exception)
                {

                    Console.WriteLine(exception.Message);
                   
                }
}


Thanks
Regards

Pages: [1]