public void UserCleanup(ref UUTData _uutData, ref CommonData _commonData) { string conStr = "Data Source=wpsqldb21;Initial Catalog=VpdOF;Persist Security Info=True;User ID=VpdTest;Password=Vpd@123"; if (iteSlot.Contains("P1")) { SQL_XGS.Update_XGS("1", "No"); SQL_34970A.Update_DMM_Status("1", "No", conStr); InstrumentIO.Close_Extleak(1); myLD1.Close(); // myLD1 = null; } else if (iteSlot.Contains("P2")) { SQL_XGS.Update_XGS("2", "No"); SQL_34970A.Update_DMM_Status("1", "No", conStr); InstrumentIO.Close_Extleak(2); myLD2.Close(); myLD2 = null; } else { } }
//@@ When the 'START' button is pressed @@// public void UserSetups(ref UUTData _uutData, ref CommonData _commonData) { recheck_connection: try { if (iteSlot.Contains("P1")) { myLD1 = new VSLeakDetector(comPort1); myLD1.iteSlot = iteSlot; myLD1.Open(); //Helper.comPort = comPort1; } else if (iteSlot.Contains("P2")) { myLD2 = new VSLeakDetector(comPort2); myLD2.iteSlot = iteSlot; myLD2.Open(); //Helper.comPort = comPort2; } else { } //Initialize data acquisition system recheck: string conStr = "Data Source=wpsqldb21;Initial Catalog=VpdOF;Persist Security Info=True;User ID=VpdTest;Password=Vpd@123"; string DMMstatus = SQL_34970A.Read_DMM_Status(conStr); if (DMMstatus != "No") { MessageBox.Show("DMM locked", "warning", MessageBoxButtons.OK); Thread.Sleep(5000); goto recheck; } InstrumentIO.DAS_initialize(); //Accquire the voltage requirement based on the model number and channel number based on the slot number of the tester InstrumentIO.Init_UUT_Voltage_Switches(_uutData.Model, _uutData.Options); } catch (Agilent.TMFramework.InstrumentIO.VisaException ex) //When there is connection error between the 34970A and the PC { DialogResult connection = MessageBox.Show(ex.Message + "\n\nPlease check the connection between the 34970A data accquisition system and the PC.", "WARNING", MessageBoxButtons.RetryCancel); if (connection == DialogResult.Retry) { goto recheck_connection; } else { Application.Exit(); } } }