//****************************************// // Hardware Initialize // //****************************************// /// <summary> /// Hardware initialize, init Agilent device and open comm for MPQ /// </summary> private void HardwareInitialize() { try { //Read Hardware Settings HardwareConfig.Read(); //Agilent agilentDevice.InitializeU2651A(HardwareConfig.Option.U2651AtxtAddr); agilentDevice.InitializeU2722A(HardwareConfig.Option.U2722AtxtAddr); agilentDevice.InitializeU2751A_WELLA(HardwareConfig.Option.U2751AtxtAddr); //agilentDevice.InitializeU2751A_WELLB(HardwareConfig.Option.U2751AWellBtxtAddr); //MPQ mpqDevice.PortInit(HardwareConfig.Port.MPQPort); toolStripStatusLabelHardware.BackColor = Color.Green; testHardwareReady = true; } catch (Exception ex) { MessageBox.Show(ex.Message, "Error:", MessageBoxButtons.OK, MessageBoxIcon.Error); toolStripStatusLabelHardware.BackColor = Color.Red; testHardwareReady = false; Log.error(ex.Message); } }
public Agilent Initialize_U2751A(string connectstring) { if (connectstring != "") { Agilent sw_A = new Agilent(); sw_A.InitializeU2751A_WELLA(connectstring); return(sw_A); } return(null); }
public static void ConnectSwitch() { try { sw = new Agilent(); SwConnected = sw.InitializeU2751A_WELLA(SW_alias); //sw.InitializeU2651A(SW_alias); } catch (Exception ex) { //Logger.PrintLog(this, "Fail to Connect Switch: " + SW_alias, LogDetailLevel.LogRelevant); } }
private void button1_Click(object sender, EventArgs e) { try { sw.InitializeU2751A_WELLA(SWAlias_textBox.Text); sw.SetRelayWellA_ALLCLOSE(); toolStripStatusLabel1.Text = "SW: " + SWAlias_textBox.Text + " is connected."; log.PrintLog(this, "U2751A is connected and all channels are closed.", LogDetailLevel.LogRelevant); button2.Focus(); } catch { toolStripStatusLabel1.Text = "SW: " + SWAlias_textBox.Text + " is not connected."; button2.Focus(); } }
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(); }