Ejemplo n.º 1
0
        public static async Task <bool> CheckPWVOUT(DV_CH ch)
        {
            bool result0   = false;
            bool result50  = false;
            bool result100 = false;

            string Data0   = "";
            string Data50  = "";
            string Data100 = "";

            try
            {
                return(await Task <bool> .Run(() =>
                {
                    switch (ch)
                    {
                    case DV_CH.DV2:
                        General.Set7012Meas(General.MEAS_CH.DV2);
                        break;

                    case DV_CH.DV4:
                        General.Set7012Meas(General.MEAS_CH.DV4);
                        break;

                    case DV_CH.DV6:
                        General.Set7012Meas(General.MEAS_CH.DV6);
                        break;

                    case DV_CH.DV8:
                        General.Set7012Meas(General.MEAS_CH.DV8);
                        break;
                    }


                    //電源ONする処理
                    General.PowerSupply(true);
                    if (!General.CheckDemo表示())
                    {
                        return false;
                    }

                    Target.SendData("PWVOUT 0 0 0 0");
                    Sleep(1500);
                    HIOKI7012.MeasureDcV(); var Meas0 = HIOKI7012.VoltData;

                    Target.SendData("PWVOUT 50 50 50 50");
                    Sleep(1500);
                    HIOKI7012.MeasureDcV(); var Meas50 = HIOKI7012.VoltData;

                    Target.SendData("PWVOUT 100 100 100 100");
                    Sleep(1500);
                    HIOKI7012.MeasureDcV(); var Meas100 = HIOKI7012.VoltData;

                    result0 = (State.TestSpec.Vout_0_Min <= Meas0 && Meas0 <= State.TestSpec.Vout_0_Max);
                    result50 = (State.TestSpec.Vout_50_Min <= Meas50 && Meas50 <= State.TestSpec.Vout_50_Max);
                    result100 = (State.TestSpec.Vout_100_Min <= Meas100 && Meas100 <= State.TestSpec.Vout_100_Max);

                    Data0 = Meas0.ToString("F2") + "V";
                    Data50 = Meas50.ToString("F2") + "V";
                    Data100 = Meas100.ToString("F2") + "V";

                    return result0 && result50 && result100;
                }));
            }
            catch
            {
                return(false);
            }
            finally
            {
                General.PowerSupply(false);
                switch (ch)
                {
                case DV_CH.DV2:
                    State.VmTestResults.DV2_0      = Data0;
                    State.VmTestResults.DV2_50     = Data50;
                    State.VmTestResults.DV2_100    = Data100;
                    State.VmTestResults.ColDV2_0   = result0 ? OffBrush : NgBrush;
                    State.VmTestResults.ColDV2_50  = result50 ? OffBrush : NgBrush;
                    State.VmTestResults.ColDV2_100 = result100 ? OffBrush : NgBrush;
                    break;

                case DV_CH.DV4:
                    State.VmTestResults.DV4_0      = Data0;
                    State.VmTestResults.DV4_50     = Data50;
                    State.VmTestResults.DV4_100    = Data100;
                    State.VmTestResults.ColDV4_0   = result0 ? OffBrush : NgBrush;
                    State.VmTestResults.ColDV4_50  = result50 ? OffBrush : NgBrush;
                    State.VmTestResults.ColDV4_100 = result100 ? OffBrush : NgBrush;
                    break;

                case DV_CH.DV6:
                    State.VmTestResults.DV6_0      = Data0;
                    State.VmTestResults.DV6_50     = Data50;
                    State.VmTestResults.DV6_100    = Data100;
                    State.VmTestResults.ColDV6_0   = result0 ? OffBrush : NgBrush;
                    State.VmTestResults.ColDV6_50  = result50 ? OffBrush : NgBrush;
                    State.VmTestResults.ColDV6_100 = result100 ? OffBrush : NgBrush;
                    break;

                case DV_CH.DV8:
                    State.VmTestResults.DV8_0      = Data0;
                    State.VmTestResults.DV8_50     = Data50;
                    State.VmTestResults.DV8_100    = Data100;
                    State.VmTestResults.ColDV8_0   = result0 ? OffBrush : NgBrush;
                    State.VmTestResults.ColDV8_50  = result50 ? OffBrush : NgBrush;
                    State.VmTestResults.ColDV8_100 = result100 ? OffBrush : NgBrush;
                    break;
                }
            }
        }
Ejemplo n.º 2
0
        public static async Task <bool> CheckPWINV()
        {
            bool result0    = false;
            bool result1800 = false;
            bool result3600 = false;

            string Data0    = "";
            string Data1800 = "";
            string Data3600 = "";



            try
            {
                return(await Task <bool> .Run(() =>
                {
                    General.Set7012Meas(General.MEAS_CH.DV13);

                    //電源ONする処理
                    General.PowerSupply(true);
                    if (!General.CheckDemo表示())
                    {
                        return false;
                    }

                    Target.SendData("PWINV 0");
                    Sleep(1500);
                    HIOKI7012.MeasureDcV(); var Meas0 = HIOKI7012.VoltData;

                    Target.SendData("PWINV 1800");
                    Sleep(1500);
                    HIOKI7012.MeasureDcV(); var Meas1800 = HIOKI7012.VoltData;

                    Target.SendData("PWINV 3600");
                    Sleep(1500);
                    HIOKI7012.MeasureDcV(); var Meas3600 = HIOKI7012.VoltData;

                    result0 = (State.TestSpec.Inv_0_Min <= Meas0 && Meas0 <= State.TestSpec.Inv_0_Max);
                    result1800 = (State.TestSpec.Inv_1800_Min <= Meas1800 && Meas1800 <= State.TestSpec.Inv_1800_Max);
                    result3600 = (State.TestSpec.Inv_3600_Min <= Meas3600 && Meas3600 <= State.TestSpec.Inv_3600_Max);

                    Data0 = Meas0.ToString("F2") + "V";
                    Data1800 = Meas1800.ToString("F2") + "V";
                    Data3600 = Meas3600.ToString("F2") + "V";

                    return result0 && result1800 && result3600;
                }));
            }
            catch
            {
                return(false);
            }
            finally
            {
                General.PowerSupply(false);
                State.VmTestResults.DV13_0       = Data0;
                State.VmTestResults.DV13_1800    = Data1800;
                State.VmTestResults.DV13_3600    = Data3600;
                State.VmTestResults.ColDV13_0    = result0 ? OffBrush : NgBrush;
                State.VmTestResults.ColDV13_1800 = result1800 ? OffBrush : NgBrush;
                State.VmTestResults.ColDV13_3600 = result3600 ? OffBrush : NgBrush;
            }
        }
Ejemplo n.º 3
0
        public static async Task <bool> CheckPWTMP_A(DV_CH ch)
        {
            bool result0   = false;
            bool result150 = false;
            bool result300 = false;

            string Data0   = "";
            string Data150 = "";
            string Data300 = "";



            try
            {
                return(await Task <bool> .Run(() =>
                {
                    switch (ch)
                    {
                    case DV_CH.DV9:
                        General.Set7012Meas(General.MEAS_CH.DV9);
                        break;

                    case DV_CH.DV11:
                        General.Set7012Meas(General.MEAS_CH.DV11);
                        break;
                    }

                    //電源ONする処理
                    General.PowerSupply(true);
                    if (!General.CheckDemo表示())
                    {
                        return false;
                    }

                    Target.SendData("PWTMP_A 0 0");
                    Sleep(2500);
                    HIOKI7012.MeasureDcV(); var Meas0 = HIOKI7012.VoltData * 10;

                    Target.SendData("PWTMP_A 150 150");
                    Sleep(2500);
                    HIOKI7012.MeasureDcV(); var Meas150 = HIOKI7012.VoltData * 10;

                    Target.SendData("PWTMP_A 300 300");
                    Sleep(2500);
                    HIOKI7012.MeasureDcV(); var Meas300 = HIOKI7012.VoltData * 10;

                    result0 = (State.TestSpec.Temp_A_0_Min <= Meas0 && Meas0 <= State.TestSpec.Temp_A_0_Max);
                    result150 = (State.TestSpec.Temp_A_150_Min <= Meas150 && Meas150 <= State.TestSpec.Temp_A_150_Max);
                    result300 = (State.TestSpec.Temp_A_300_Min <= Meas300 && Meas300 <= State.TestSpec.Temp_A_300_Max);

                    Data0 = Meas0.ToString("F2") + "mA";
                    Data150 = Meas150.ToString("F2") + "mA";
                    Data300 = Meas300.ToString("F2") + "mA";

                    return result0 && result150 && result300;
                }));
            }
            catch
            {
                return(false);
            }
            finally
            {
                General.PowerSupply(false);
                switch (ch)
                {
                case DV_CH.DV9:
                    State.VmTestResults.DV9_0      = Data0;
                    State.VmTestResults.DV9_150    = Data150;
                    State.VmTestResults.DV9_300    = Data300;
                    State.VmTestResults.ColDV9_0   = result0 ? OffBrush : NgBrush;
                    State.VmTestResults.ColDV9_150 = result150 ? OffBrush : NgBrush;
                    State.VmTestResults.ColDV9_300 = result300 ? OffBrush : NgBrush;
                    break;

                case DV_CH.DV11:
                    State.VmTestResults.DV11_0      = Data0;
                    State.VmTestResults.DV11_150    = Data150;
                    State.VmTestResults.DV11_300    = Data300;
                    State.VmTestResults.ColDV11_0   = result0 ? OffBrush : NgBrush;
                    State.VmTestResults.ColDV11_150 = result150 ? OffBrush : NgBrush;
                    State.VmTestResults.ColDV11_300 = result300 ? OffBrush : NgBrush;
                    break;
                }
            }
        }
Ejemplo n.º 4
0
        public static async Task <bool> CheckPWTMP_V(DV_CH ch)
        {
            bool result0  = false;
            bool result40 = false;
            bool result75 = false;

            string Data0  = "";
            string Data40 = "";
            string Data75 = "";



            try
            {
                return(await Task <bool> .Run(() =>
                {
                    switch (ch)
                    {
                    case DV_CH.DV10:
                        General.Set7012Meas(General.MEAS_CH.DV10);
                        break;

                    case DV_CH.DV12:
                        General.Set7012Meas(General.MEAS_CH.DV12);
                        break;
                    }

                    //電源ONする処理
                    General.PowerSupply(true);
                    if (!General.CheckDemo表示())
                    {
                        return false;
                    }

                    Target.SendData("PWTMP_V 0 0");
                    Sleep(1500);
                    HIOKI7012.MeasureDcV(); var Meas0 = HIOKI7012.VoltData;

                    Target.SendData("PWTMP_V 40 40");
                    Sleep(1500);
                    HIOKI7012.MeasureDcV(); var Meas40 = HIOKI7012.VoltData;

                    Target.SendData("PWTMP_V 75 75");
                    Sleep(1500);
                    HIOKI7012.MeasureDcV(); var Meas75 = HIOKI7012.VoltData;

                    result0 = (State.TestSpec.Temp_V_0_Min <= Meas0 && Meas0 <= State.TestSpec.Temp_V_0_Max);
                    result40 = (State.TestSpec.Temp_V_40_Min <= Meas40 && Meas40 <= State.TestSpec.Temp_V_40_Max);
                    result75 = (State.TestSpec.Temp_V_75_Min <= Meas75 && Meas75 <= State.TestSpec.Temp_V_75_Max);

                    Data0 = Meas0.ToString("F2") + "V";
                    Data40 = Meas40.ToString("F2") + "V";
                    Data75 = Meas75.ToString("F2") + "V";

                    return result0 && result40 && result75;
                }));
            }
            catch
            {
                return(false);
            }
            finally
            {
                General.PowerSupply(false);
                switch (ch)
                {
                case DV_CH.DV10:
                    State.VmTestResults.DV10_0     = Data0;
                    State.VmTestResults.DV10_40    = Data40;
                    State.VmTestResults.DV10_75    = Data75;
                    State.VmTestResults.ColDV10_0  = result0 ? OffBrush : NgBrush;
                    State.VmTestResults.ColDV10_40 = result40 ? OffBrush : NgBrush;
                    State.VmTestResults.ColDV10_75 = result75 ? OffBrush : NgBrush;
                    break;

                case DV_CH.DV12:
                    State.VmTestResults.DV12_0     = Data0;
                    State.VmTestResults.DV12_40    = Data40;
                    State.VmTestResults.DV12_75    = Data75;
                    State.VmTestResults.ColDV12_0  = result0 ? OffBrush : NgBrush;
                    State.VmTestResults.ColDV12_40 = result40 ? OffBrush : NgBrush;
                    State.VmTestResults.ColDV12_75 = result75 ? OffBrush : NgBrush;
                    break;
                }
            }
        }
        public static async Task <bool> CheckVolt(VOL_CH ch)
        {
            bool   result   = false;
            Double measData = 0;
            double Max      = 0;
            double Min      = 0;

            try
            {
                return(await Task <bool> .Run(() =>
                {
                    try
                    {
                        SetRelay(ch);
                        Thread.Sleep(400);

                        switch (ch)
                        {
                        case VOL_CH._12V:
                            Max = State.TestSpec.V12v_Max;
                            Min = State.TestSpec.V12v_Min;
                            break;

                        case VOL_CH._5V:
                            Max = State.TestSpec.V5v_Max;
                            Min = State.TestSpec.V5v_Min;
                            break;

                        case VOL_CH._3_3V:
                            Max = State.TestSpec.V3v_Max;
                            Min = State.TestSpec.V3v_Min;
                            break;

                        case VOL_CH.AVDD:
                            Max = State.TestSpec.Avdd_Max;
                            Min = State.TestSpec.Avdd_Min;
                            break;

                        case VOL_CH.AVCC:
                            Max = State.TestSpec.Avcc_Max;
                            Min = State.TestSpec.Avcc_Min;
                            break;

                        case VOL_CH.VREF:
                            Max = State.TestSpec.Vref_Max;
                            Min = State.TestSpec.Vref_Min;
                            break;

                        case VOL_CH.AVCCD:
                            Max = State.TestSpec.Avccd_Max;
                            Min = State.TestSpec.Avccd_Min;
                            break;

                        case VOL_CH.S5V:
                            Max = State.TestSpec.S5v_Max;
                            Min = State.TestSpec.S5v_Min;
                            break;
                        }

                        if (ch == VOL_CH.VREF)
                        {
                            HIOKI7012.MeasureDcV(HIOKI7012.MEAS_MODE.V_2_5);
                        }
                        else
                        {
                            HIOKI7012.MeasureDcV();
                        }

                        measData = HIOKI7012.VoltData;

                        return result = (Min < measData && measData < Max);
                    }
                    catch
                    {
                        return result = false;
                    }
                }));
            }
            finally
            {
                //ビューモデルの更新
                switch (ch)
                {
                case VOL_CH._12V:
                    State.VmTestResults.Vol12V    = measData.ToString("F2") + "V";
                    State.VmTestResults.ColVol12V = result ? General.OffBrush : General.NgBrush;
                    break;

                case VOL_CH._5V:
                    State.VmTestResults.Vol5V    = measData.ToString("F2") + "V";
                    State.VmTestResults.ColVol5V = result ? General.OffBrush : General.NgBrush;
                    break;

                case VOL_CH._3_3V:
                    State.VmTestResults.Vol3_3V    = measData.ToString("F2") + "V";
                    State.VmTestResults.ColVol3_3V = result ? General.OffBrush : General.NgBrush;
                    break;

                case VOL_CH.AVDD:
                    State.VmTestResults.VolAVDD    = measData.ToString("F2") + "V";
                    State.VmTestResults.ColVolAVDD = result ? General.OffBrush : General.NgBrush;
                    break;

                case VOL_CH.AVCC:
                    State.VmTestResults.VolAVCC    = measData.ToString("F2") + "V";
                    State.VmTestResults.ColVolAVCC = result ? General.OffBrush : General.NgBrush;
                    break;

                case VOL_CH.VREF:
                    State.VmTestResults.VolVREF    = measData.ToString("F4") + "V";
                    State.VmTestResults.ColVolVREF = result ? General.OffBrush : General.NgBrush;
                    break;

                case VOL_CH.AVCCD:
                    State.VmTestResults.VolAVCCD    = measData.ToString("F2") + "V";
                    State.VmTestResults.ColVolAVCCD = result ? General.OffBrush : General.NgBrush;
                    break;

                case VOL_CH.S5V:
                    State.VmTestResults.VolS5V    = measData.ToString("F2") + "V";
                    State.VmTestResults.ColVolS5V = result ? General.OffBrush : General.NgBrush;
                    break;
                }

                //NGだった場合、エラー詳細情報の規格値を更新する
                if (!result)
                {
                    if (ch == VOL_CH.VREF)
                    {
                        State.VmTestStatus.Spec      = $"規格値 : {Min.ToString("F4")} ~ {Max.ToString("F4")}V";
                        State.VmTestStatus.MeasValue = "計測値 : " + measData.ToString("F4") + "V";
                    }
                    else
                    {
                        State.VmTestStatus.Spec      = $"規格値 : {Min.ToString("F2")} ~ {Max.ToString("F2")}V";
                        State.VmTestStatus.MeasValue = "計測値 : " + measData.ToString("F2") + "V";
                    }
                }
            }
        }