Example #1
0
        /*------------------------------------------------------------------------------------------------------------------------------------------
         * This test sequence is for UUT Information storage such as UUT Model Number, Serial Numbers, Cal Leak Information
         * Spectube, Valve Block and External Cal Leak Information
         * -------------------------------------------------------------------------------------------------------------------------------------------*/
        public static void DoUUTInfoTest(ref TestInfo myTestInfo, UUTData myUUTData, CommonData myCommonData, string[] UUTInfos)
        {
            try
            {
                string intCalLeakSN = UUTInfos[0];
                string extCalLeakPN = UUTInfos[1];
                string extCalLeakSN = UUTInfos[2];
recheck:
                string conStr = "Data Source=wpsqldb21;Initial Catalog=VpdOF;Persist Security Info=True;User ID=VpdTest;Password=Vpd@123";
                SQL_34970A.Calibrated(conStr);
                string DMMstatus = SQL_34970A.Read_DMM_Status(conStr);

                if (DMMstatus == "No")
                {
                }
                else
                {
                    Trace.WriteLine("DMM locked");
                    Thread.Sleep(5000);
                    goto recheck;
                }

                int step = 1;
                myTestInfo.ResultsParams[step].Result      = myTestInfo.ResultsParams[step].SpecMin =
                    myTestInfo.ResultsParams[step].Nominal = myTestInfo.ResultsParams[step].SpecMax = myUUTData.Model; // UUT model
                step++;
                myTestInfo.ResultsParams[step].Result      = myTestInfo.ResultsParams[step].SpecMin =
                    myTestInfo.ResultsParams[step].Nominal = myTestInfo.ResultsParams[step].SpecMax = myUUTData.SerNum; // UUT serial
                step++;
                myTestInfo.ResultsParams[step].Result      = myTestInfo.ResultsParams[step].SpecMin =
                    myTestInfo.ResultsParams[step].Nominal = myTestInfo.ResultsParams[step].SpecMax = intCalLeakSN; // UUT Int Cal Leak Serial number
                step++;
                myTestInfo.ResultsParams[step].Result      = myTestInfo.ResultsParams[step].SpecMin =
                    myTestInfo.ResultsParams[step].Nominal = myTestInfo.ResultsParams[step].SpecMax = extCalLeakPN; // Ext Cal Leak Part Number
                step++;
                myTestInfo.ResultsParams[step].Result      = myTestInfo.ResultsParams[step].SpecMin =
                    myTestInfo.ResultsParams[step].Nominal = myTestInfo.ResultsParams[step].SpecMax = extCalLeakSN; // Ext Cal Leak Serial number
                step++;
                myTestInfo.ResultsParams[step].Result      = myTestInfo.ResultsParams[step].SpecMin =
                    myTestInfo.ResultsParams[step].Nominal = myTestInfo.ResultsParams[step].SpecMax = myUUTData.Options; // slot number
                step++;
            }
            catch (Exception)
            {
                throw;
            }
        }
Example #2
0
        // We are not using below functions anymore

        public static void IOBoard(VSLeakDetector myLD, ref TestInfo myTestInfo, ref UUTData myuutdata)
        {
            Boolean status = false;
            string  retval;

            switch (myTestInfo.TestLabel)
            {
            case "5.12.1 Test_IOBoard (Opt.)":
            {
                while (step <= myTestInfo.ResultsParams.NumResultParams)
                {
                    //Access to full command

                    Trace.WriteLine(iteSlot + "Access to full command...");
                    Helper.SendCommand(myLD, ref status, "XYZZY", "XYZZY ok");

                    //Obtain stdleak rate

                    Trace.WriteLine(iteSlot + "Obtain the stdleak rate...");
                    retval = Helper.SendCommand(myLD, ref status, "?STDLEAK", "ok");

                    if (status == true)
                    {
                        string[] response = retval.Split(new string[] { "?STDLEAK ", "ok" }, StringSplitOptions.RemoveEmptyEntries);
                        Stdleak = Convert.ToDouble(response[0]);
                    }


                    //lock DMM from other test sockets while it is being used

                    int    checking = 1;
                    string conStr   = myTestInfo.TestParams[1].Value;

                    Trace.WriteLine(iteSlot + "Check before Locking the DMM...");

                    while (checking > 0)
                    {
                        string DMMstatus = SQL_34970A.Read_DMM_Status(conStr);

                        if (DMMstatus == "No")
                        {
                            SQL_34970A.Update_DMM_Status(myuutdata.Options, "Yes", conStr);            //Yes = Lock     No = Unlock
                            break;
                        }

                        Thread.Sleep(5000);
                    }


                    //@@ Prompt user to turn off the leak detector and attach the cabbling @@//

                    step++;


                    //@@ Prompt user to turn on the unit @@//

                    step++;


                    //@@ Sets and leaves the Parallel_Enable_In value high @@//

                    step++;


                    Trace.WriteLine(iteSlot + "Startup wait...");
                    Thread.Sleep(30000);


                    //@@ Sends ?IOBOARD command to the unit @@//

                    step++;


                    //@@ Wait for the Ready_out line value to go HIGH @@//

                    step++;


                    //@@ Sends VENT bit on the appropriate output port. @@//

                    step++;


                    Trace.WriteLine(iteSlot + "Waits for unit to respond to new DI value...");
                    Thread.Sleep(10000);


                    //@@ Reads VENT_out bit on the appropriate input port. @@//

                    step++;


                    Thread.Sleep(5000);


                    //@@ Sets the value of the contra-flow mode crossover pressure in Torr @@//

                    Helper.DoThis(myLD, ref myTestInfo, "1.0E-3 INIT-CL-XFER", "ok", step, "ok");
                    step++;


                    //@@ Set Test_In @@//

                    step++;


                    Trace.WriteLine(iteSlot + "Waits for unit to respond to new DI value...");
                    Thread.Sleep(3000);


                    //@@ Verify Start_Out @@//

                    step++;


                    //@@ Verify Test_Out @@//

                    step++;


                    //@@ Wait for the START_OUT line value to go LOW @@//

                    step++;


                    //@@ Verify Test_Out @@//

                    step++;


                    //@@ Sets the value of the contra-flow mode crossover pressure in Torr @@//

                    Helper.DoThis(myLD, ref myTestInfo, "1.0E+1 INIT-CL-XFER", "ok", step, "ok");
                    step++;


                    //@@ Set RDSTDLK_IN High @@//

                    step++;


                    Trace.WriteLine(iteSlot + "Waits for unit to respond to new DI value...");
                    Thread.Sleep(1000);


                    //@@ Check STD valve state.vi @@//

                    step++;


                    //@@ Set RDSTDLK_IN low @@//

                    step++;


                    Trace.WriteLine(iteSlot + "Waits for unit to respond to new DI value...");
                    Thread.Sleep(1000);


                    //@@ Check STD valve state.vi @@//

                    step++;


                    Trace.WriteLine(iteSlot + "Waits for unit to respond to new DI value...");
                    Thread.Sleep(8000);


                    //@@ Set Hold_In @@//

                    step++;


                    Trace.WriteLine(iteSlot + "Waits for unit to respond to new DI value...");
                    Thread.Sleep(1000);


                    //@@ Verify Hold_Out @@//

                    step++;


                    Trace.WriteLine(iteSlot + "Waits for unit to respond to new DI value...");
                    Thread.Sleep(5000);


                    //@@ Set Test_In @@//

                    step++;


                    Trace.WriteLine(iteSlot + "Waits for unit to respond to new DI value...");
                    Thread.Sleep(15000);


                    //@@ Set Zero_In @@//

                    step++;


                    Trace.WriteLine(iteSlot + "Waits for unit to respond to new DI value...");
                    Thread.Sleep(10000);


                    //@@ Sets which type of calibration will be run if the CALIBRATE command is initiated.  Preceded by 0 or 1, 0 for FULL cal, 1 for FAST cal. @@//

                    Helper.DoThis(myLD, ref myTestInfo, "1 INIT-QUICK-CAL", "ok", step, "ok");
                    step++;


                    //@@ Set CAL_In @@//

                    step++;


                    Trace.WriteLine(iteSlot + "Waits for unit to respond to new DI value...");
                    Thread.Sleep(2000);


                    //@@ Verify CAL_Out @@//

                    step++;


                    //@@ Wait for CAL_Out line value to go LOW @@//

                    step++;


                    //@@ Verify CAL_Out_ok @@//

                    step++;


                    //@@ Sets which type of calibration will be run if the CALIBRATE command is initiated.  Preceded by 0 or 1, 0 for FULL cal, 1 for FAST cal. @@//

                    Helper.DoThis(myLD, ref myTestInfo, "0 INIT-QUICK-CAL", "ok", step, "ok");
                    step++;


                    //@@ Set AUTO_Manual_Range_In @@//

                    step++;


                    Trace.WriteLine(iteSlot + "Waits for unit to respond to new DI value...");
                    Thread.Sleep(2000);


                    //@@ Sends .AUTOMAN command to the unit @@//

                    Helper.DoThis(myLD, ref myTestInfo, ".AUTOMAN", "manual ok", step, "ok");
                    step++;


                    //@@ Set AUTO_Manual_Range_In @@//

                    step++;


                    Trace.WriteLine(iteSlot + "Waits for unit to respond to new DI value...");
                    Thread.Sleep(2000);


                    //@@ Sends .AUTOMAN command to the unit @@//

                    Helper.DoThis(myLD, ref myTestInfo, ".AUTOMAN", "automatic ok", step, "ok");
                    step++;


                    //@@ Sets the leak rate value for Reject Set Point #1. The helium leak rate value is in atm cc/sec. @@//

                    Helper.DoThis(myLD, ref myTestInfo, "1.0E-08 INIT-1REJECT", "ok", step, "ok");
                    step++;


                    //@@ Sets the leak rate value for Reject Set Point #2. The helium leak rate value is in atm cc/sec. @@//

                    Helper.DoThis(myLD, ref myTestInfo, "1.0E-08 INIT-2REJECT", "ok", step, "ok");
                    step++;


                    //@@ Sets the leak rate value for Reject Set Point #3. The helium leak rate value is in atm cc/sec. @@//

                    Helper.DoThis(myLD, ref myTestInfo, "1.0E-00 INIT-3REJECT", "ok", step, "ok");
                    step++;


                    //@@ Sets the leak rate value for Reject Set Point #4. The helium leak rate value is in atm cc/sec. @@//

                    Helper.DoThis(myLD, ref myTestInfo, "1.0E-08 INIT-4REJECT", "ok", step, "ok");
                    step++;


                    //@@ Pressure reject set point #1. @@//

                    Helper.DoThis(myLD, ref myTestInfo, "LOW-1REJECT", "ok", step, "ok");
                    step++;


                    //@@ Pressure reject set point #2. @@//

                    Helper.DoThis(myLD, ref myTestInfo, "LOW-2REJECT", "ok", step, "ok");
                    step++;


                    //@@ Pressure reject set point #3. @@//

                    Helper.DoThis(myLD, ref myTestInfo, "LOW-3REJECT", "ok", step, "ok");
                    step++;


                    //@@ Pressure reject set point #4. @@//

                    Helper.DoThis(myLD, ref myTestInfo, "LOW-4REJECT", "ok", step, "ok");
                    step++;


                    //@@ Turn ON reject set point #1 @@//

                    Helper.DoThis(myLD, ref myTestInfo, "ENABLE-1REJECT", "ok", step, "ok");
                    step++;


                    //@@ Turn ON reject set point #2 @@//

                    Helper.DoThis(myLD, ref myTestInfo, "ENABLE-2REJECT", "ok", step, "ok");
                    step++;


                    //@@ Turn ON reject set point #3 @@//

                    Helper.DoThis(myLD, ref myTestInfo, "ENABLE-3REJECT", "ok", step, "ok");
                    step++;


                    //@@ Turn ON reject set point #4 @@//

                    Helper.DoThis(myLD, ref myTestInfo, "ENABLE-4REJECT", "ok", step, "ok");
                    step++;


                    //@@ Set VENT_IN @@//

                    step++;


                    Trace.WriteLine(iteSlot + "Waits for unit to respond to new DI value...");
                    Thread.Sleep(10000);


                    //@@ Set TEST_IN @@//

                    step++;


                    Trace.WriteLine(iteSlot + "Waits for system leak rate to go below 8.0E-09...");
                    Thread.Sleep(35000);


                    //@@ Verify REJECT1_OUT @@//

                    step++;


                    //@@ Verify REJECT2_OUT @@//

                    step++;


                    //@@ Verify REJECT3_OUT @@//

                    step++;


                    //@@ Verify REJECT4_OUT @@//

                    step++;


                    //@@ Turn OFF reject set point #1 @@//

                    Helper.DoThis(myLD, ref myTestInfo, "DISABLE-1REJECT", "ok", step, "ok");
                    step++;


                    //@@ Turn OFF reject set point #2 @@//

                    Helper.DoThis(myLD, ref myTestInfo, "DISABLE-2REJECT", "ok", step, "ok");
                    step++;


                    //@@ Turn OFF reject set point #3 @@//

                    Helper.DoThis(myLD, ref myTestInfo, "DISABLE-3REJECT", "ok", step, "ok");
                    step++;


                    //@@ Turn OFF reject set point #4 @@//

                    Helper.DoThis(myLD, ref myTestInfo, "DISABLE-4REJECT", "ok", step, "ok");
                    step++;


                    //@@ Set PARALLEL_ENABLE_IN @@//

                    step++;


                    //Lorcfffdervvck DIO



                    //@@ Prompt user to disconnect the I/O tester @@//

                    step++;
                }

                break;
            }

            case "5.12.2 Wireless_Remote (Opt.)":
            {
                while (step <= myTestInfo.ResultsParams.NumResultParams)
                {
                    myTestInfo.ResultsParams[step].SpecMax = "Skip";
                    myTestInfo.ResultsParams[step].SpecMin = "Skip";
                    myTestInfo.ResultsParams[step].Nominal = "Skip";
                    myTestInfo.ResultsParams[step].Result  = "Skip";

                    step++;
                }

                break;
            }
            }
        }
Example #3
0
        public static TestInfo DoSeq5_1(VSLeakDetector myLD, ref TestInfo myTestInfo, ref UUTData myuutdata)
        {
            string     reading;
            userprompt my_userprompt = new userprompt();

            try
            {
                switch (myTestInfo.TestLabel)
                {
                case "5.1.1 Power":
                {
                    //@@ Ensure that the power cord is not plugged into the UUT & the main AC supply outlet. @@//

                    Trace.WriteLine(iteSlot + "Disconnect the power supply from the UUT...");

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")
                    {
                    }
                    else
                    {
                        Trace.WriteLine("DMM locked");
                        Thread.Sleep(5000);
                        goto recheck;
                    }

                    InstrumentIO.DAS_Power_OFF(myuutdata.Options);
                    myTestInfo.ResultsParams[1].Result = "ok";

                    break;
                }

                case "5.1.2 Check_PumpVoltage":
                {
                    /*@@ SKIP* Check the LD has the correct voltage mechanical pump installed (115VAC or 230VAC) or that the voltage selector switch
                     * on the vacuum pump is set to meet the rated mains AC requirements for that model LD. @@*/

                    myTestInfo.ResultsParams[1].Result = "ok";

                    break;
                }

                case "5.1.3 Check_Setup":
                {
                    //@@ Prompt user to ensure that all KF clamps, grounding straps, cable and wire connections between the PCBs, valves and pumps are in place. @@//

                    string display = "Seq 5.1.3:\nEnsure that all KF clamps, grounding straps, cable and wire connections between the PCBs,\nvalves and pumps are in place. Enter 'ok' once done.";
                    string Reading = Helper.LabelDisplay(display);

                    myTestInfo.ResultsParams[1].Result = Reading;

                    break;
                }

                case "5.1.5 Measure_Resistance":
                {
                    //Lock the DDM from other test sockets while it is been used. Before that, verify whether it is locked or not.
                    int    step      = 1;
                    int    checking  = 1;
                    string DMMstatus = "";
                    string conStr    = myTestInfo.TestParams[1].Value;
                    string res_range = myTestInfo.TestParams[2].Value;

                    Trace.WriteLine(iteSlot + "Check before Locking the DMM...");

                    while (checking > 0)
                    {
recheck:
                        DMMstatus = SQL_34970A.Read_DMM_Status(conStr);

                        if (DMMstatus == "No")
                        {
                            SQL_34970A.Update_DMM_Status(myuutdata.Options, "Yes", conStr);              //Yes = Lock     No = Unlock
                            Thread.Sleep(5000);
                            break;
                        }
                        else
                        {
                            MessageBox.Show("DMM locked", "warning", MessageBoxButtons.OK);
                            Thread.Sleep(5000);
                            goto recheck;
                        }
                    }

                    MessageBox.Show("Please flip Leak Detector switch to OFF positions", "OFF Switch", MessageBoxButtons.OK, MessageBoxIcon.Information);

                    //@@ Measure resistance between line blade and neutral blade OFF (0.8~1.2) @@//

                    Trace.WriteLine(iteSlot + "Measure resistance between line blade and neutral blade OFF");

                    //reading = InstrumentIO.Measure_Resistance(4, res_range);
                    reading = InstrumentIO.Measure_Res_LB_NB_OFF();
                    Trace.WriteLine(iteSlot + "Test point complete.");
                    myTestInfo.ResultsParams[step].Result = reading;

                    step++;


                    //@@ Measure resistance between line blade and ground blade OFF @@//

                    Trace.WriteLine(iteSlot + "Measure resistance between line blade and ground blade OFF...");
                    reading = InstrumentIO.Measure_Resistance(2, res_range);

                    if (Convert.ToDouble(reading) > 10000000)
                    {
                        Trace.WriteLine(iteSlot + "Test point complete.");
                        myTestInfo.ResultsParams[step].Result = "100000000";
                    }
                    else
                    {
                        myTestInfo.ResultsParams[step].Result = reading;
                        //throw new Exception("Measured value out of acceptable range.");
                    }

                    step++;


                    //@@ Measure resistance between neutral blade and ground blade OFF @@//

                    Trace.WriteLine(iteSlot + "Measure resistance between neutral blade and ground blade OFF...");
                    reading = InstrumentIO.Measure_Resistance(3, res_range);

                    if (Convert.ToDouble(reading) > 10000000)
                    {
                        Trace.WriteLine(iteSlot + "Test point complete.");
                        myTestInfo.ResultsParams[step].Result = "100000000";
                    }

                    else
                    {
                        myTestInfo.ResultsParams[step].Result = reading;
                        //throw new Exception("Measured value out of acceptable range.");
                    }
                    step++;

                    MessageBox.Show("Please flip Leak Detector switch to ON positions", "ON Switch", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    //@@ Measure resistance between the gnd blade and tp metal (< 0.8) @@//

                    Trace.WriteLine(iteSlot + "Measure resistance between the gnd blade and tp metal (< 0.8)...");
                    double res1 = InstrumentIO.Measure_Resistance(0, "100", "0.001");
                    //reading = InstrumentIO.Measure_Resistance(0, res_range);
                    myTestInfo.ResultsParams[step].Result = res1.ToString();
                    step++;


                    //@@ Measure resistance between the ground blade and grounding stud. (< 0.8) @@//

                    Trace.WriteLine(iteSlot + "Measure resistance between the ground blade and grounding stud. (< 0.8)...");
                    //reading = InstrumentIO.Measure_Resistance(1, res_range);
                    double res2 = InstrumentIO.Measure_Resistance(0, "100", "0.001");
                    myTestInfo.ResultsParams[step].Result = res2.ToString();
                    Trace.WriteLine(iteSlot + "Test point complete.");
                    step++;


                    //@@ Measure resistance between line blade and neutral blade ON (Based on model) @@//
                    List <string> listOfLimits = new List <string>();
                    listOfLimits.Add(myTestInfo.TestParams[3].Value);
                    listOfLimits.Add(myTestInfo.TestParams[4].Value);
                    listOfLimits.Add(myTestInfo.TestParams[5].Value);
                    listOfLimits.Add(myTestInfo.TestParams[6].Value);
                    listOfLimits.Add(myTestInfo.TestParams[7].Value);
                    listOfLimits.Add(myTestInfo.TestParams[8].Value);

                    Trace.WriteLine(iteSlot + "Measure resistance between line blade and neutral blade ON (Based on model)...");
                    string resReading = InstrumentIO.Measure_Res_LB_NB_ON(myuutdata.Model, res_range, listOfLimits.ToArray(), ref myTestInfo, step);
                    Trace.WriteLine(iteSlot + "Test point completed");
                    myTestInfo.ResultsParams[step].Result = resReading;
                    step++;


                    //@@ Measure resistance between line blade and ground blade ON @@//

                    Trace.WriteLine(iteSlot + "Measure resistance between line blade and ground blade ON...");
                    reading = InstrumentIO.Measure_Resistance(2, res_range);

                    if (Convert.ToDouble(reading) > 10000000)
                    {
                        Trace.WriteLine(iteSlot + "Test point complete.");
                        myTestInfo.ResultsParams[step].Result = "100000000";
                    }

                    else
                    {
                        myTestInfo.ResultsParams[step].Result = reading;
                        //throw new Exception("Measured value out of acceptable range.");
                    }

                    step++;


                    //@@ Measure resistance between neutral blade and ground blade ON @@//

                    Trace.WriteLine(iteSlot + "Measure resistance between neutral blade and ground blade ON...");
                    reading = InstrumentIO.Measure_Resistance(3, res_range);

                    if (Convert.ToDouble(reading) > 10000000)
                    {
                        Trace.WriteLine(iteSlot + "Test point complete.");
                        myTestInfo.ResultsParams[step].Result = "100000000";
                    }

                    else
                    {
                        myTestInfo.ResultsParams[step].Result = reading;
                        //throw new Exception("Measured value out of acceptable range.");
                    }

                    step++;

                    //Unlock DMM

                    Trace.WriteLine(iteSlot + "Unlocking the DMM...");
                    conStr = myTestInfo.TestParams[1].Value;

                    // SQL_34970A.Update_DMM_Status(myuutdata.Options, "No", conStr);
                    step++;
                }
                break;
                }
            }

            catch (Exception ex)
            {
                Trace.WriteLine(ex.Message);
                Helper.Fail_Test(ref myTestInfo, ex.Message, 1);
                throw;
            }

            return(myTestInfo);
        }
Example #4
0
        public static TestInfo DoSeq5_13(VSLeakDetector myLD, ref TestInfo myTestInfo, ref UUTData myuutdata)
        {
            Boolean status = false;
            string  reading;
            int     step = 1;

            //Helper.comPort = comPort;

            try
            {
                switch (myTestInfo.TestLabel)
                {
                case "5.13.1 Power":
                {
                    //Lock the DMM

                    int    checking = 1;
                    string conStr   = myTestInfo.TestParams[1].Value;

                    while (checking > 0)
                    {
                        string DMMstatus = SQL_34970A.Read_DMM_Status(conStr);

                        if (DMMstatus == "No")
                        {
                            SQL_34970A.Update_DMM_Status(myuutdata.Options, "Yes", conStr);            //Yes = Lock     No = Unlock
                            break;
                        }

                        Thread.Sleep(5000);
                    }


                    //@@ Disconnect power from the UUT @@//

                    Trace.WriteLine(iteSlot + "Disconnect power from the UUT...");
                    if (iteSlot.Contains("P1"))
                    {
                        InstrumentIO.DAS_Power_OFF("1");
                        Trace.WriteLine(iteSlot + "Unlocking the DMM...");
                        SQL_34970A.Update_DMM_Status("1", "No", conStr);
                    }
                    else
                    {
                        InstrumentIO.DAS_Power_OFF("2");
                        Trace.WriteLine(iteSlot + "Unlocking the DMM...");
                        SQL_34970A.Update_DMM_Status("2", "No", conStr);
                    }
                    Trace.WriteLine(iteSlot + "Test point complete.");
                    myTestInfo.ResultsParams[step].Result = "ok";


                    break;
                }

                case "5.13.3 Measure_Resistane":
                {
                    string res_range = myTestInfo.TestParams[2].Value;

                    //@@ Measure resistance between the gnd blade and tp metal (< 0.8) @@//

                    Trace.WriteLine(iteSlot + "Measure resistance between the gnd blade and tp metal (< 0.8)...");
                    double res1 = InstrumentIO.Measure_Resistance(0, "100", "0.001");
                    //reading = InstrumentIO.Measure_Resistance(0, res_range);
                    myTestInfo.ResultsParams[step].Result = res1.ToString();
                    //Trace.WriteLine(iteSlot + "Test point complete.");
                    //if (Convert.ToDouble(reading) < 0.8)
                    //{

                    //    myTestInfo.ResultsParams[step].Result = reading;
                    //}

                    //else
                    //{
                    //    myTestInfo.ResultsParams[step].Result = reading;
                    //    //throw new Exception("Measured value out of acceptable range.");
                    //}

                    step++;


                    //@@ Measure resistance between the ground blade and grounding stud. (< 0.8) @@//

                    Trace.WriteLine(iteSlot + "Measure resistance between the ground blade and grounding stud. (< 0.8)...");
                    //reading = InstrumentIO.Measure_Resistance(1, res_range);
                    double res2 = InstrumentIO.Measure_Resistance(0, "100", "0.001");
                    myTestInfo.ResultsParams[step].Result = res2.ToString();
                    Trace.WriteLine(iteSlot + "Test point complete.");
                    //if (Convert.ToDouble(reading) < 0.8)
                    //{

                    //    myTestInfo.ResultsParams[step].Result = reading;
                    //}

                    //else
                    //{
                    //    myTestInfo.ResultsParams[step].Result = reading;
                    //    //throw new Exception("Measured value out of acceptable range.");
                    //}

                    step++;


                    //@@ Measure resistance between line blade and neutral blade ON (Based on model) @@//
                    List <string> listOfLimits = new List <string>();
                    listOfLimits.Add(myTestInfo.TestParams[3].Value);
                    listOfLimits.Add(myTestInfo.TestParams[4].Value);
                    listOfLimits.Add(myTestInfo.TestParams[5].Value);
                    listOfLimits.Add(myTestInfo.TestParams[6].Value);
                    listOfLimits.Add(myTestInfo.TestParams[7].Value);
                    listOfLimits.Add(myTestInfo.TestParams[8].Value);

                    Trace.WriteLine(iteSlot + "Measure resistance between line blade and neutral blade ON (Based on model)...");
                    string resReading = InstrumentIO.Measure_Res_LB_NB_ON(myuutdata.Model, res_range, listOfLimits.ToArray(), ref myTestInfo, step);
                    Trace.WriteLine(iteSlot + "Test point completed");
                    myTestInfo.ResultsParams[step].Result = resReading;
                    step++;


                    //@@ Measure resistance between line blade and ground blade ON @@//

                    Trace.WriteLine(iteSlot + "Measure resistance between line blade and ground blade ON...");
                    reading = InstrumentIO.Measure_Resistance(2, res_range);

                    if (Convert.ToDouble(reading) > 10000000)
                    {
                        Trace.WriteLine(iteSlot + "Test point complete.");
                        myTestInfo.ResultsParams[step].Result = "100000000";
                    }

                    else
                    {
                        myTestInfo.ResultsParams[step].Result = reading;
                        //throw new Exception("Measured value out of acceptable range.");
                    }

                    step++;


                    //@@ Measure resistance between neutral blade and ground blade ON @@//

                    Trace.WriteLine(iteSlot + "Measure resistance between neutral blade and ground blade ON...");
                    reading = InstrumentIO.Measure_Resistance(3, res_range);

                    if (Convert.ToDouble(reading) > 10000000)
                    {
                        Trace.WriteLine(iteSlot + "Test point complete.");
                        myTestInfo.ResultsParams[step].Result = "100000000";
                    }

                    else
                    {
                        myTestInfo.ResultsParams[step].Result = reading;
                        //throw new Exception("Measured value out of acceptable range.");
                    }

                    step++;

                    MessageBox.Show("Please flip Leak Detector switch to OFF positions", "OFF Switch", MessageBoxButtons.OK, MessageBoxIcon.Information);

                    //@@ Measure resistance between line blade and neutral blade OFF (0.8~1.2) @@//

                    Trace.WriteLine(iteSlot + "Measure resistance between line blade and neutral blade OFF");

                    //reading = InstrumentIO.Measure_Resistance(4, res_range);
                    reading = InstrumentIO.Measure_Res_LB_NB_OFF();
                    Trace.WriteLine(iteSlot + "Test point complete.");
                    myTestInfo.ResultsParams[step].Result = reading;

                    step++;


                    //@@ Measure resistance between line blade and ground blade OFF @@//

                    Trace.WriteLine(iteSlot + "Measure resistance between line blade and ground blade OFF...");
                    reading = InstrumentIO.Measure_Resistance(2, res_range);

                    if (Convert.ToDouble(reading) > 10000000)
                    {
                        Trace.WriteLine(iteSlot + "Test point complete.");
                        myTestInfo.ResultsParams[step].Result = "100000000";
                    }
                    else
                    {
                        myTestInfo.ResultsParams[step].Result = reading;
                        //throw new Exception("Measured value out of acceptable range.");
                    }

                    step++;


                    //@@ Measure resistance between neutral blade and ground blade OFF @@//

                    Trace.WriteLine(iteSlot + "Measure resistance between neutral blade and ground blade OFF...");
                    reading = InstrumentIO.Measure_Resistance(3, res_range);

                    if (Convert.ToDouble(reading) > 10000000)
                    {
                        Trace.WriteLine(iteSlot + "Test point complete.");
                        myTestInfo.ResultsParams[step].Result = "100000000";
                    }

                    else
                    {
                        myTestInfo.ResultsParams[step].Result = reading;
                        //throw new Exception("Measured value out of acceptable range.");
                    }

                    //Unlock DMM

                    step++;
                }

                break;
                }
            }

            catch (Exception ex)
            {
                Trace.WriteLine(ex.Message);
                Helper.Fail_Test(ref myTestInfo, ex.Message, step);
                throw;
            }

            return(myTestInfo);
        }
Example #5
0
        public static TestInfo DoSeq5_2(VSLeakDetector myLD, ref TestInfo myTestInfo, ref UUTData myuutdata, ref CommonData myCommonData)
        {
            string Display;
            string reading;
            string retval;
            int    step = 1;

            Helper.comPort = comPort;

            //VSLeakDetector myLD = new VSLeakDetector(comPort);

            try
            {
                switch (myTestInfo.TestLabel)
                {
                case "5.2.4 Communication_Setup":
                {
                    step = 1;

                    //@@ Connect the power cord to the main AC supply. @@//

                    Trace.WriteLine("Power ON the UUT...");

                    InstrumentIO.DAS_Power_ON(myuutdata.Options);

                    myTestInfo.ResultsParams[step].Result = "ok";

                    Trace.WriteLine("Test point complete.");

                    step++;


                    //@@ Serial port communication test @@//

                    Trace.WriteLine("Verify the serial port communication between the UUT and the PC...");

                    //myLD.Open();
                    int timeout = 1;
                    myLD.Timeout    = 1000;
                    myLD.Terminator = "\r\n";

                    while (timeout > 0)
                    {
                        retval = myLD.Read();

                        if (retval.Contains("ok"))
                        {
                            myTestInfo.ResultsParams[step].Result = "ok";
                            Trace.WriteLine("Test point complete.");

                            break;
                        }

                        if (timeout > 100)
                        {
                            myTestInfo.ResultsParams[step].Result = "FAILED";
                            //throw new Exception("Test point failed.");
                        }

                        Thread.Sleep(1000);
                        timeout++;
                    }

                    //myLD.Close();
                    break;
                }

                case "5.2.4 PreheatSetup":
                {
                    string conStr1 = "Data Source=wpsqldb21;Initial Catalog=VpdOF;Persist Security Info=True;User ID=VpdTest;Password=Vpd@123";
                    SQL_34970A.Update_DMM_Status(myuutdata.Options, "No", conStr1);
                    string SN            = myuutdata.SerNum;
                    string Model         = myuutdata.Model;
                    MyForm myPreheatForm = new MyForm(myLD);
                    //myPreheatForm.comPort = comPort;
                    myPreheatForm.ShowDialog();

                    string disValue = myPreheatForm.Pvvalue;
                    if (disValue == "Abort")
                    {
                        MessageBox.Show("Aborted by user", "ABORTED", MessageBoxButtons.OK);
                        myCommonData.Mode = "Abort";
                    }

                    disValue = disValue.Trim(new Char[] { ' ', '?', 'P', 'V' });
                    disValue = disValue.TrimEnd(new Char[] { ' ', 'o', 'k', '\r', '\n' });
                    myTestInfo.ResultsParams[1].Result = disValue;
                    myTestInfo.ResultsParams[2].Result = Convert.ToString(myPreheatForm.checkvolt);
                    string conStr = "Data Source=wpsqldb21;Initial Catalog=VpdOF;Persist Security Info=True;User ID=VpdTest;Password=Vpd@123";
                    using (SqlConnection my_sql = new SqlConnection(conStr))
                    {
                        my_sql.Open();

                        SqlCommand command = new SqlCommand("insert into PV(LOT,MODEL,PREHEAT,RESULT,DAC,FIRMWARE,ION_SOURCE)" +
                                                            "VALUES('" + SN + "','" + Model + "','" + myPreheatForm.checkvolt + "','PASS','" + disValue + "','1.04'" + ",'" + myPreheatForm.ISsn + "')", my_sql);
                        command.ExecuteNonQuery();
                        my_sql.Close();
                    }

                    break;
                }

                case "5.2.5 Measure_DCVoltage":
                {
                    step = 1;

                    //Lock DMM

                    string conStr   = myTestInfo.TestParams[1].Value;
                    int    checking = 1;

                    //while (checking > 0)
                    //{
                    //    string DMMstatus = SQL_34970A.Read_DMM_Status(conStr);

                    //    if (DMMstatus == "No")
                    //    {
                    //        SQL_34970A.Update_DMM_Status(myuutdata.Options, "Yes", conStr);    //Yes = Lock     No = Unlock
                    //        break;
                    //    }

                    //    Thread.Sleep(5000);
                    //}


                    //@@ Measure the voltage between the black and red wire of the chasis fan connector. The acceptable range is 22.8V ~ 25.2V @@//

                    Trace.WriteLine("Measuring the voltage of the chasis fan connector...");
                    FormDcPowerSupply dcvForm = new FormDcPowerSupply();
                    dcvForm.StartPosition = FormStartPosition.Manual;
                    dcvForm.Location      = new System.Drawing.Point(locX, locY);
                    dcvForm.ShowDialog();
                    double dcvReading = 0;
                    if (dcvForm.DialogResult == DialogResult.OK)
                    {
                        dcvReading = dcvForm.DcVolt;
                    }
                    else
                    {
                        dcvReading = dcvForm.DcVolt;
                        //throw new Exception("24V measurement canceled by user!");
                    }

                    myTestInfo.ResultsParams[1].Result = dcvReading.ToString();
                    //reading = InstrumentIO.Measure_DCV("");

                    //if (Convert.ToDouble(reading) >= 22.8 && Convert.ToDouble(reading) <= 25.2)
                    //{
                    //    Trace.WriteLine("Test point complete.");
                    //    myTestInfo.ResultsParams[step].Result = reading;
                    //}

                    //else
                    //{
                    //    myTestInfo.ResultsParams[step].Result = reading;
                    //    //throw new Exception("Measured value out of acceptable range.");
                    //}

                    //Unlock DMM

                    //Trace.WriteLine("Unlocking the DMM...");
                    //SQL_34970A.Update_DMM_Status(myuutdata.Options, "No", conStr);

                    break;
                }

                case "5.2.6 Check_Fan":
                {
                    step = 1;

                    //@@ To verify the condition of both fans @@//

                    Trace.WriteLine("Verify the condition of both fans...");

                    Display = "Seq 5.2.6:\nPlease verify the condition of BOTH fans. Are they running as expected? \n\nEnter 'ok' if pass. Else 'no'";
                    reading = Helper.LabelDisplay(Display);

                    if (reading == "ok")
                    {
                        Trace.WriteLine("Test point complete.");
                        myTestInfo.ResultsParams[step].Result = reading;
                    }

                    else if (reading == "no")
                    {
                        myTestInfo.ResultsParams[step].Result = reading;
                        //throw new Exception("One or both fans are not functioning properly.");
                    }

                    break;
                }
                }
            }

            catch (Exception ex)
            {
                Trace.WriteLine(ex.Message);
                Helper.Fail_Test(ref myTestInfo, ex.Message, step);
                throw;
            }

            return(myTestInfo);
        }