Exemple #1
0
 //****************************************//
 //             Power Control              //
 //****************************************//
 private void SetupPowerSupply(double VDD)
 {
     try
     {
         m_Agilent.SetChannelVoltage(VDD, AGILENT_POWER_CHANNEL1);
         m_Agilent.SetChannelVoltage(VDD, AGILENT_POWER_CHANNEL2);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error:", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Exemple #2
0
        public void testDUT()
        {
            if (instrument_initiated == false)
            {
                //MessageBox.Show("Instruments not initiated", "Error:", MessageBoxButtons.OK, MessageBoxIcon.Error);
                //return;
                if (partType == "11500400")
                {
                    Init_Bridge();
                    try
                    {
                        agilentDevice.InitializeU2722A(Config.U2722_ADDRESS);
                        instrument_initiated = true;
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message, "Error:", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        dut.ErrorCode = ErrorCode.EEROR_SYSTEM_ERROR;
                        return;
                    }
                }
                if (partType == "11500500")
                {
                    try
                    {
                        agilentDevice.InitializeU2722A(Config.U2722_ADDRESS);
                        instrument_initiated = true;
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message, "Error:", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        dut.ErrorCode = ErrorCode.EEROR_SYSTEM_ERROR;
                        return;
                    }
                }
            }
            if (partType == "11500400")
            {
                SetListBoxStatus("Optics POD Test");
                //LED test
                // “Testing/reading LED current consumption:”
                SetListBoxStatus("Testing/reading LED current consumption:");
                agilentDevice.SetChannelVoltage(LED_Volt, LED_Channal);
                agilentDevice.ActivateChannelOutput(LED_Channal);
                System.Threading.Thread.Sleep(LED_Delay);

                List <double> CurrentLED = new List <double>();
                for (byte j = 0; j < 5; j++)
                {
                    CurrentLED.Add(agilentDevice.MeasureChannelCurrent(LED_Channal) * 1000);
                    System.Threading.Thread.Sleep(LED_Delay);
                    SetListBoxStatus(CurrentLED[j].ToString());
                }
                agilentDevice.De_ActivateChannelOutput(LED_Channal);
                dut.LED = CurrentLED.Average();
                if (dut.LED < Config.LED_MIN)
                {
                    dut.ErrorCode = ErrorCode.ERROR_LED_LOW;
                }
                else if (dut.LED > Config.LED_MAX)
                {
                    dut.ErrorCode = ErrorCode.ERROR_LED_HIGH;
                }



                //ALS test

                try
                { BridgePowerOff(); }  //try to stop the bridge if it's in use.
                catch
                {
                    dut.ErrorCode = ErrorCode.ERROR_NO_TRACKPAD_IN_SLOT;
                }
                try
                {
                    SetListBoxStatus("Testing/reading ALS output in dark environment:");
                    BridgePowerOn();
                    System.Threading.Thread.Sleep(ALS_Delay);
                    bridge.Write(0xEC);
                    agilentDevice.De_ActivateChannelOutput(ALS_Channal);
                    System.Threading.Thread.Sleep(ALS_Delay);
                    byte[] dataOff = bridge.Read(2);
                    dut.ALS_dark = Convert.ToInt32(Convert.ToInt32(dataOff[0]) * 256 + Convert.ToInt32(dataOff[1]));
                    SetListBoxStatus(dut.ALS_dark.ToString());

                    SetListBoxStatus("Testing/reading ALS output with LED illumination");
                    agilentDevice.SetChannelVoltage(ALS_Volt, ALS_Channal);
                    agilentDevice.ActivateChannelOutput(ALS_Channal);
                    System.Threading.Thread.Sleep(ALS_Delay * 2);
                    byte[] dataOn = bridge.Read(2);
                    agilentDevice.De_ActivateChannelOutput(ALS_Channal);
                    dut.ALS_light = Convert.ToInt32(Convert.ToInt32(dataOn[0]) * 256 + Convert.ToInt32(dataOn[1]));
                    SetListBoxStatus(dut.ALS_light.ToString());
                    //dut.ALS=

                    if (dataOff.Count() == 2 && dataOn.Count() == 2)
                    {
                        if (dut.ALS_dark > Config.ALS_DARK)
                        {
                            dut.ErrorCode = ErrorCode.ERROR_ALS_HIGH;
                        }
                        if (dut.ALS_light < Config.ALS_LIGHT)
                        {
                            dut.ErrorCode = ErrorCode.ERROR_ALS_LOW;
                        }
                    }
                    else
                    {
                        dut.ErrorCode = ErrorCode.ERROR_NO_ALS;
                    }
                }
                catch
                {
                    dut.ErrorCode = ErrorCode.ERROR_NO_TRACKPAD_IN_SLOT;
                }
                finally
                {
                    BridgePowerOff();
                }
            }
            if (partType == "11500500")
            {
                try
                {
                    SetListBoxStatus("Main POD Test");
                    SetListBoxStatus("Testing/reading Thermal Resistor values(KOhm)");
                    agilentDevice.SetChannelVoltage(RES_Volt, RES_Channal);
                    agilentDevice.ActivateChannelOutput(RES_Channal);
                    System.Threading.Thread.Sleep(RES_Delay);

                    List <double> CurrentR = new List <double>();
                    for (byte j = 0; j < 5; j++)
                    {
                        CurrentR.Add(agilentDevice.MeasureChannelCurrent(RES_Channal) * 1000);
                        System.Threading.Thread.Sleep(RES_Delay);
                        SetListBoxStatus(Convert.ToString(RES_Volt / CurrentR[j] - 10));//use 12 in IQC fixture in US Jabil
                    }
                    agilentDevice.De_ActivateChannelOutput(RES_Channal);
                    dut.Resistor = Convert.ToInt32(RES_Volt / CurrentR.Average() - 10);//use 12 in IQC fixture in US Jabil
                    if (dut.Resistor < Config.RESISTOR_MIN)
                    {
                        dut.ErrorCode = ErrorCode.ERROR_RES_LOW;
                    }
                    else if (dut.Resistor > Config.RESISTOR_MAX)
                    {
                        dut.ErrorCode = ErrorCode.ERROR_RES_HIGH;
                    }
                }
                catch (Exception ex)
                {
                    dut.ErrorCode = ErrorCode.ERROR_NO_TRACKPAD_IN_SLOT;
                }
                System.Threading.Thread.Sleep(200);
            }
            if (checkBoxCallMTK.Checked)
            {
                CallMTK();
            }
        }
Exemple #3
0
 private void textBoxVoltage_TextChanged(object sender, EventArgs e)
 {
     agilentDevice.SetChannelVoltage(Convert.ToDouble(textBoxVoltage.Text), 1);
 }