diff --git a/.vs/Testrong.User.Program/v17/.suo b/.vs/Testrong.User.Program/v17/.suo index 8f1362a..a2e3518 100644 Binary files a/.vs/Testrong.User.Program/v17/.suo and b/.vs/Testrong.User.Program/v17/.suo differ diff --git a/.vs/Testrong.User.Program/v17/DocumentLayout.backup.json b/.vs/Testrong.User.Program/v17/DocumentLayout.backup.json index 40e02e8..7f93a8f 100644 --- a/.vs/Testrong.User.Program/v17/DocumentLayout.backup.json +++ b/.vs/Testrong.User.Program/v17/DocumentLayout.backup.json @@ -28,7 +28,7 @@ "RelativeDocumentMoniker": "Testrong.User.Program\\UserProgram.cs", "ToolTip": "D:\\WORK\\ManLin\\Verify\\UserProgram_time\\Testrong.User.Program\\UserProgram.cs", "RelativeToolTip": "Testrong.User.Program\\UserProgram.cs", - "ViewState": "AgIAAOwMAAAAAAAAAAA4wJgHAABBAAAAAAAAAA==", + "ViewState": "AgIAAG8KAAAAAAAAAAAUwHQKAABBAAAAAAAAAA==", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "WhenOpened": "2024-06-18T12:27:43.78Z", "EditorCaption": "" diff --git a/.vs/Testrong.User.Program/v17/DocumentLayout.json b/.vs/Testrong.User.Program/v17/DocumentLayout.json index 70823cf..615bfde 100644 --- a/.vs/Testrong.User.Program/v17/DocumentLayout.json +++ b/.vs/Testrong.User.Program/v17/DocumentLayout.json @@ -28,7 +28,7 @@ "RelativeDocumentMoniker": "Testrong.User.Program\\UserProgram.cs", "ToolTip": "D:\\WORK\\ManLin\\Verify\\UserProgram_time\\Testrong.User.Program\\UserProgram.cs", "RelativeToolTip": "Testrong.User.Program\\UserProgram.cs", - "ViewState": "AgIAADwGAAAAAAAAAAAYwJgHAABBAAAAAAAAAA==", + "ViewState": "AgIAAJUDAAAAAAAAAAAiwLEDAAANAAAAAAAAAA==", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "WhenOpened": "2024-06-18T12:27:43.78Z", "EditorCaption": "" diff --git a/Testrong.User.Program/UserProgram.cs b/Testrong.User.Program/UserProgram.cs index 0d00eb3..afdcea0 100644 --- a/Testrong.User.Program/UserProgram.cs +++ b/Testrong.User.Program/UserProgram.cs @@ -919,15 +919,31 @@ namespace Testrong.User.Program { double[] IntBoard_Res = new double[256]; int cnt3 = 0; - StreamReader IntResReader = new StreamReader(RintFilePath, Encoding.UTF8); - while (!IntResReader.EndOfStream) + try { - string[] A = IntResReader.ReadLine().Split(' ', ':'); - IntBoard_Res[cnt3] = Convert.ToDouble(A[4]); - cnt3 = cnt3 + 1; + // 提前检查文件是否存在,避免深层构造器异常 + if (!File.Exists(RintFilePath)) + { + throw new FileNotFoundException($"File not found: {RintFilePath}"); + } + + using (var IntResReader = new StreamReader(RintFilePath, Encoding.UTF8)) + { + while (!IntResReader.EndOfStream) + { + string[] A = IntResReader.ReadLine().Split(' ', ':'); + IntBoard_Res[cnt3] = Convert.ToDouble(A[4]); + cnt3 = cnt3 + 1; + } + IntResReader.Close(); + return IntBoard_Res; + } + } + catch (Exception ex) + { + LogRawText(ex.StackTrace); // 调用日志记录方法 + throw; // 重新抛出保留原始堆栈追踪 } - IntResReader.Close(); - return IntBoard_Res; } public List RangeTrans(List range) { @@ -2248,6 +2264,12 @@ namespace Testrong.User.Program armDnaRaw = armDnaRaw.Reverse().ToArray(); string arm_dna = BitConverter.ToUInt64(armDnaRaw, 0).ToString(); int SlotNum = context.Communicator.SlotNo; + + //Get PMU_R + string Currnet_IP_NUM = context.Communicator.ServerIP; + string PMUR_FileName = "C:\\ProgramData\\Testrong\\ATE_Tester\\CalibrationLog\\RintCal\\PMUR\\" + Currnet_IP_NUM + "_Pmur.txt"; + double[] current_ip_pmuRint = ReadRint(PMUR_FileName); + #endregion //-----Select PreTest or ReTest----- #region 选择第一次测试还是复测 @@ -2438,7 +2460,7 @@ namespace Testrong.User.Program { if (Range == "60mA") { - dmm.Setup(NiVisaComms.Dmm3458AMeasureMode.CURR, DmmCurrRanges[Range], 0.04); + dmm.Setup(NiVisaComms.Dmm3458AMeasureMode.CURR, DmmCurrRanges[Range], 1); } else { @@ -2605,6 +2627,7 @@ namespace Testrong.User.Program PPMU.Force(PmuPinName, ForceVoltage, ModesPmu[Mode], RangesPmu[Range], VRange.Normal); Thread.Sleep(testParaSet_pmu_fvmi[Range].delayMs); dmm.TriggerSingleMeasure(); + Thread.Sleep(50); List siList = PPMU.Measure(PmuPinName, true, context.BinHandler.GetBinningByTestSuite("ExtCalibration_FVMI"), testParaSet_pmu_fvmi[Range].avgTimes, testParaSet_pmu_fvmi[Range].samDelay); double chResult = GetATEChannelMeasure(siList, PmuPinName); double[] readTemp = PPMU.ReadTemperature(); @@ -2673,7 +2696,14 @@ namespace Testrong.User.Program } List siList = PPMU.Measure(PmuPinName, true, context.BinHandler.GetBinningByTestSuite("ExtCalibration_FIMV"), testParaSet_pmu_fimv[Range].avgTimes, testParaSet_pmu_fimv[Range].samDelay); double chResult = GetATEChannelMeasure(siList, PmuPinName); - AteMeasure[p] = chResult / (Convert.ToDouble(RlPmuFi[Range]) + ExtBoard_Res[ch - 1, SlotNum - 1]); + double Real_V = 0; + double ExtRload = Convert.ToDouble(RlPmuFi[Range]); + + Real_V = chResult + ForceCurrent * current_ip_pmuRint[ListChannels[loopk] - 1]; + double Total_Rint = current_ip_pmuRint[ListChannels[loopk] - 1] + ExtBoard_Res[ListChannels[loopk] - 1, SlotNum - 1]; + double Real_I = Real_V / (Total_Rint + ExtRload); + AteMeasure[p] = (Real_V - (Total_Rint * Real_I)) / ExtRload; + //AteMeasure[p] = chResult / (Convert.ToDouble(RlPmuFi[Range]) + ExtBoard_Res[ch - 1, SlotNum - 1]); ForceValue[p] = ForceCurrent; double[] readTemp = PPMU.ReadTemperature(); double chTemp = readTemp[GetPMUTempSensorIndex(ch)]; diff --git a/Testrong.User.Program/bin/x64/Debug/UserProgram.dll b/Testrong.User.Program/bin/x64/Debug/UserProgram.dll index 439f820..7e7085e 100644 Binary files a/Testrong.User.Program/bin/x64/Debug/UserProgram.dll and b/Testrong.User.Program/bin/x64/Debug/UserProgram.dll differ diff --git a/Testrong.User.Program/bin/x64/Debug/UserProgram.pdb b/Testrong.User.Program/bin/x64/Debug/UserProgram.pdb index 690b2b3..bd30ca8 100644 Binary files a/Testrong.User.Program/bin/x64/Debug/UserProgram.pdb and b/Testrong.User.Program/bin/x64/Debug/UserProgram.pdb differ diff --git a/Testrong.User.Program/obj/x64/Debug/Testrong.User.Program.csproj.AssemblyReference.cache b/Testrong.User.Program/obj/x64/Debug/Testrong.User.Program.csproj.AssemblyReference.cache index 2eea0e9..674eee6 100644 Binary files a/Testrong.User.Program/obj/x64/Debug/Testrong.User.Program.csproj.AssemblyReference.cache and b/Testrong.User.Program/obj/x64/Debug/Testrong.User.Program.csproj.AssemblyReference.cache differ diff --git a/Testrong.User.Program/obj/x64/Debug/Testrong.User.Program.csproj.CoreCompileInputs.cache b/Testrong.User.Program/obj/x64/Debug/Testrong.User.Program.csproj.CoreCompileInputs.cache index fa737b9..5e43543 100644 --- a/Testrong.User.Program/obj/x64/Debug/Testrong.User.Program.csproj.CoreCompileInputs.cache +++ b/Testrong.User.Program/obj/x64/Debug/Testrong.User.Program.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -e22cab61aa47f7f86ab40c847a6a130a00a4b8a3 +1c5e67c428e7ea9ad83db74e3225f3a6ee4bdaaf429227caea859a4df23e5fee diff --git a/Testrong.User.Program/obj/x64/Debug/UserProgram.dll b/Testrong.User.Program/obj/x64/Debug/UserProgram.dll index 439f820..7e7085e 100644 Binary files a/Testrong.User.Program/obj/x64/Debug/UserProgram.dll and b/Testrong.User.Program/obj/x64/Debug/UserProgram.dll differ diff --git a/Testrong.User.Program/obj/x64/Debug/UserProgram.pdb b/Testrong.User.Program/obj/x64/Debug/UserProgram.pdb index 690b2b3..bd30ca8 100644 Binary files a/Testrong.User.Program/obj/x64/Debug/UserProgram.pdb and b/Testrong.User.Program/obj/x64/Debug/UserProgram.pdb differ