예제 #1
0
        public MultiMeter Initialize_U3606A(string connectstring)
        {
            if (connectstring != "")
            {
                MultiMeter dmm = new MultiMeter(connectstring);
                return(dmm);
            }

            return(null);
        }
예제 #2
0
 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);
     }
 }
예제 #3
0
        public Form1()
        {
            InitializeComponent();

            channelBox1.Text = "CH1";
            channelBox2.Text = "CH2";
            channelBox3.Text = "CH3";
            channelBox4.Text = "CH4";
            channelBox5.Text = "CH5";
            channelBox6.Text = "CH6";
            channelBox7.Text = "CH7";
            channelBox8.Text = "CH8";



            DMM = Initialize_U3606A(DmmX8_Plus.Properties.Settings.Default.DMM_Alias);

            if (MultiMeter.devReadyStatus.Contains("Connect to U3606A Successfully!!!"))
            {
                dmm_status.Text      = "Ready";
                dmm_status.ForeColor = Color.DarkGreen;
                devReady             = true;
                checkBox1.Checked    = true;
            }
            else
            {
                MessageBox.Show("Connect to U3606A failed on " + DmmX8_Plus.Properties.Settings.Default.DMM_Alias, "Instrument Initializaion Error");
                checkBox1.Checked = false;
            }

            SW_A = Initialize_U2751A(DmmX8_Plus.Properties.Settings.Default.Switch_Alias);

            if (Agilent.devReadyStatus == true)
            {
                sw_status.Text      = "Ready";
                sw_status.ForeColor = Color.DarkGreen;
                devReady            = true;
                checkBox2.Checked   = true;
            }
            else
            {
                MessageBox.Show("Connect to U2751A failed on " + DmmX8_Plus.Properties.Settings.Default.Switch_Alias, "Instrument Initializaion Error");
                checkBox2.Checked = false;
            }



            serialnumberbox1.Focus();
        }
예제 #4
0
        public MTKInstruments(LogManager logger)
        {
            try
            {
                dmm = new MultiMeter();
                sw  = new Agilent();

                logger = new LogManager();

                Logger = logger;
            }
            catch (Exception)
            {
                //throw;
            }
        }
예제 #5
0
        private static double PerformVoltageTest(MultiMeter dmm, Agilent sw, int channel)
        {
            double value = -1.0;

            MultiMeter.volt volt_meas;

            sw.SetRelayWellA_byCH(channel, true);


            volt_meas = dmm.MeasureChannelVoltage(500, 500);

            value = volt_meas.average;

            Console.WriteLine(string.Format("Obtain the average result of PerformVoltageTest: {0} V on CH{1}", Math.Round(value, 4), channel));

            return(value);
        }
예제 #6
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                MultiMeter dmm = new MultiMeter(DmmAlias_textBox.Text);
                sw.InitializeU2751A_WELLA(swAlias_textBox.Text);
                sw.SetRelayWellA_ALLCLOSE();

                toolStripStatusLabel1.Text = "DMM&SW: " + DmmAlias_textBox.Text + " && " + swAlias_textBox.Text + " are connected.";


                log.PrintLog(this, "U2751A is connected and all channels are closed.", LogDetailLevel.LogRelevant);
                button2.Focus();
            }
            catch
            {
                toolStripStatusLabel1.Text = "DMM&&SW: " + DmmAlias_textBox.Text + " OR " + swAlias_textBox.Text + " is not connected.";
                button2.Focus();
            }
        }
예제 #7
0
        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();
        }