public static void ConnectDMM() { try { dmm = new MultiMeter(); DmmConnected = dmm.InitializeU3606A(DMM_alias); } catch (Exception ex) { //Logger.PrintLog(this, "Fail to Connect DMM: " + DMM_alias, LogDetailLevel.LogRelevant); } }
static void Main(string[] args) { MultiMeter dmm = new MultiMeter(); Agilent sw = new Agilent(); bool dmmConnected = false; bool swConnected = false; try { dmmConnected = dmm.InitializeU3606A("dmm"); swConnected = sw.InitializeU2751A_WELLA("swA"); } catch (Exception ex) { Console.WriteLine(ex.Message); } if (!dmmConnected && swConnected) { if (!dmmConnected) { Console.WriteLine("U3606A is not connected. Please check the connection..."); } if (!swConnected) { Console.WriteLine("U2751A is not connected. Please check the connection..."); } } else { Console.WriteLine("U3606A/U2751A are connected successfully!"); Console.WriteLine(""); try { Console.WriteLine("Perform Current Test on CH1 to CH8"); //Perform Current Test on CH1 to CH8 for (int i = 0; i < 8; i++) { PerformCurrentTest(dmm, sw, i + 1); } Console.WriteLine(""); Console.WriteLine("Perform Voltage Test on CH1 to CH8"); //Perform Voltage Test on CH1 to CH8 for (int i = 0; i < 8; i++) { PerformVoltageTest(dmm, sw, i + 1); } } catch (Exception ex) { Console.WriteLine(ex.Message); } } Console.ReadKey(); }