public static void ConnectSwitch() { try { sw = new Agilent(); SwConnected = sw.InitializeU2751A_WELLA(SW_alias); sw.SetRelayWellA_ALLCLOSE(); //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(); } }
public static Current MeasureChannelCurrent(int ch_no) { init(); if (!swConnected) { ConnectSwitch(); } //Switch on dedicated DUT Power (switch off others) SwitchDutPower(ch_no, PowerSupplyState.PowerOn); if (!dmmConnected) { ConnectDMM(); } if (AlldevReady) { try { MultiMeter.current MEASCurrent = dmm.MeasureChannelCurrent(DelayBeforeMeasure, DelayAfterMeasure); //Convert reading value to mA value switch (DUTCurrent.unit) { case CurrentUnit.A: DUTCurrent.average = (double)Math.Round((MEASCurrent.average) * MeasUnitMultipler, 2); DUTCurrent.max = (double)Math.Round((MEASCurrent.max) * MeasUnitMultipler, 2); DUTCurrent.min = (double)Math.Round((MEASCurrent.min) * MeasUnitMultipler, 2); break; case CurrentUnit.mA: DUTCurrent.average = (double)Math.Round((MEASCurrent.average), 2); DUTCurrent.max = (double)Math.Round((MEASCurrent.max), 2); DUTCurrent.min = (double)Math.Round((MEASCurrent.min), 2); break; case CurrentUnit.uA: DUTCurrent.average = (double)Math.Round((MEASCurrent.average) / MeasUnitMultipler, 2); DUTCurrent.max = (double)Math.Round((MEASCurrent.max) / MeasUnitMultipler, 2); DUTCurrent.min = (double)Math.Round((MEASCurrent.min) / MeasUnitMultipler, 2); break; case CurrentUnit.nA: DUTCurrent.average = (double)Math.Round((MEASCurrent.average) / MeasUnitMultipler / MeasUnitMultipler, 2); DUTCurrent.max = (double)Math.Round((MEASCurrent.max) / MeasUnitMultipler / MeasUnitMultipler, 2); DUTCurrent.min = (double)Math.Round((MEASCurrent.min) / MeasUnitMultipler / MeasUnitMultipler, 2); break; default: break; } } catch (Exception) { } finally { //Switch On all DUTs sw.SetRelayWellA_ALLCLOSE(); } } return(DUTCurrent); }