From 1cedc93a664b6e675b14f6b7e56d89fc21fafc85 Mon Sep 17 00:00:00 2001 From: hyelinjung Date: Wed, 4 Mar 2026 17:03:09 +0900 Subject: [PATCH] =?UTF-8?q?1.=EA=B8=B0=EB=8A=A5=EA=B2=80=EC=82=AC=20spectr?= =?UTF-8?q?um,=20scope=20clear=20=EC=98=88=EC=99=B8=EC=B2=98=EB=A6=AC=202.?= =?UTF-8?q?=EB=B2=84=EC=A0=84=202.2.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ProductFunctionTester/Main_Form.vb | 58 ++++++++++++++++--------- ProductFunctionTester/ScopeMoudule.vb | 30 +++++-------- ProductFunctionTester/SpectrumModule.vb | 13 +++++- 3 files changed, 60 insertions(+), 41 deletions(-) diff --git a/ProductFunctionTester/Main_Form.vb b/ProductFunctionTester/Main_Form.vb index 7cf03ed..5fbb60c 100644 --- a/ProductFunctionTester/Main_Form.vb +++ b/ProductFunctionTester/Main_Form.vb @@ -10,7 +10,7 @@ Imports uPLibrary.Networking.M2Mqtt Public Class Main_Form Public Program_Name As String = "DUALSONIC_Multi_Function_Tester Ver." - Public Program_Version As String = "2.2.2" + Public Program_Version As String = "2.2.3" ''데이터 베이스 테이블 목록 @@ -4834,7 +4834,8 @@ NormalEnd: End If startFail: - myscope.IO.Clear() + ScopeClear() + SpecClear() txbWindow.AppendText("[" & MeasureTimeAll(MeasEnd) & "ms] Test Play" & vbCrLf) End Sub @@ -4966,7 +4967,8 @@ processEnd: Jig_End() startFail: - myscope.IO.Clear() + ScopeClear() + SpecClear() txbWindow.AppendText("[" & MeasureTimeAll(MeasEnd) & "ms] Test Play" & vbCrLf) End Sub @@ -5126,7 +5128,8 @@ ProcessEnd: Jig_End() NormalEnd: - myscope.IO.Clear() + ScopeClear() + SpecClear() txbWindow.AppendText("[" & MeasureTimeAll(MeasEnd) & "ms] Test Play" & vbCrLf) End Sub @@ -5351,7 +5354,8 @@ processEnd: Jig_End() ErrorEnd: - myscope.IO.Clear() + ScopeClear() + SpecClear() txbWindow.AppendText("[" & MeasureTimeAll(MeasEnd) & "ms] Test Play" & vbCrLf) End Sub @@ -5556,7 +5560,8 @@ processEnd: End If Jig_End() ErrorEnd: - myscope.IO.Clear() + ScopeClear() + SpecClear() txbWindow.AppendText("[" & MeasureTimeAll(MeasEnd) & "ms] Test Play" & vbCrLf) End Sub @@ -5692,7 +5697,8 @@ processEnd: Jig_End() ErrorEnd: - myscope.IO.Clear() + ScopeClear() + SpecClear() txbWindow.AppendText("[" & MeasureTimeAll(MeasEnd) & "ms] Test Play" & vbCrLf) End Sub @@ -5837,7 +5843,8 @@ ProcessEnd: End If Jig_End() NormalEnd: - myscope.IO.Clear() + ScopeClear() + SpecClear() Try If TestError = False Then Jig_End() ' 지그 전원 차단 @@ -5987,7 +5994,8 @@ processEnd: Jig_End() ErrorEnd: - myscope.IO.Clear() + ScopeClear() + SpecClear() txbWindow.AppendText("[" & MeasureTimeAll(MeasEnd) & "ms] Test Play" & vbCrLf) End Sub @@ -6181,8 +6189,8 @@ ProcessEnd: End If Jig_End() NormalEnd: - myscope.IO.Clear() - 'txbWindow.AppendText("[" & MeasureTimeAll(MeasEnd) & "ms] Test Play" & vbCrLf) + ScopeClear() + SpecClear() Try If TestError = False Then @@ -6194,7 +6202,6 @@ NormalEnd: txbWindow.AppendText("정상 종료 처리 중 오류: " & normalEx.Message & vbCrLf) End Try - 'myscope.IO.Clear() txbWindow.AppendText("[" & MeasureTimeAll(MeasEnd) & "ms] Test Play" & vbCrLf) End Sub Private Sub ldmVrmsFunction() @@ -6322,7 +6329,8 @@ RunSuccess: ProcessEnd: Jig_End() NormalEnd: - myscope.IO.Clear() + ScopeClear() + SpecClear() Try If TestError = False Then @@ -6334,7 +6342,7 @@ NormalEnd: txbWindow.AppendText("정상 종료 처리 중 오류: " & normalEx.Message & vbCrLf) End Try - 'myscope.IO.Clear() + 'ScopeClear() txbWindow.AppendText("[" & MeasureTimeAll(MeasEnd) & "ms] Test Play" & vbCrLf) End Sub @@ -6592,6 +6600,8 @@ ProcessEnd: Jig_End() NormalEnd: + ScopeClear() + SpecClear() txbWindow.AppendText("[" & MeasureTimeAll(MeasEnd) & "ms] Test Play" & vbCrLf) End Sub @@ -6766,7 +6776,8 @@ ProcessEnd: NormalEnd: txbWindow.AppendText("[" & MeasureTimeAll(MeasEnd) & "ms] Test Play" & vbCrLf) - myscope.IO.Clear() + ScopeClear() + SpecClear() End Sub @@ -7033,7 +7044,8 @@ ProcessEnd: End If Jig_End() NormalEnd: - myscope.IO.Clear() + ScopeClear() + SpecClear() txbWindow.AppendText("[" & MeasureTimeAll(MeasEnd) & "ms] Test Play" & vbCrLf) End Sub @@ -7172,7 +7184,8 @@ ProcessEnd: End If Jig_End() startFail: - myscope.IO.Clear() + ScopeClear() + SpecClear() txbWindow.AppendText("[" & MeasureTimeAll(MeasEnd) & "ms] Test Play" & vbCrLf) End Sub @@ -7308,7 +7321,8 @@ ProcessEnd: Jig_End() NormalEnd: - myscope.IO.Clear() + ScopeClear() + SpecClear() txbWindow.AppendText("[" & MeasureTimeAll(MeasEnd) & "ms] Test Play" & vbCrLf) End Sub @@ -7639,7 +7653,8 @@ NormalEnd: NormalEnd: FailMain() If formType = formTypeList.prdRFMCEP Then - myscope.IO.Clear() + ScopeClear() + SpecClear() End If Exit Sub @@ -7647,7 +7662,8 @@ NormalEnd: ProcessEnd: FailMain() Jig_End() - myscope.IO.Clear() + ScopeClear() + SpecClear() End Sub Private Function CountChanage() As Boolean @@ -10112,7 +10128,7 @@ WR_File_Error: End If If McUseYn = True And HifuUseYn = False Then comboBoxVerificationStep.Items.Add(New DictionaryEntry("수입검사(RF/EP/MC)", "iqcRFEPMC")) ''맥시멈 생산 화면 - comboBoxVerificationStep.Items.Add(New DictionaryEntry("생산1-2(RF/MC)", "prdRFMC")) ''맥시멈 생산 화면 + comboBoxVerificationStep.Items.Add(New DictionaryEntry("생산1(RF/MC)", "prdRFMC")) ''맥시멈 생산 화면 End If If EpUseYn = True And (HifuUseYn = False And LdmUseYn = False) Then comboBoxVerificationStep.Items.Add(New DictionaryEntry("생산1-1(EP)", "prdEP")) ''맥시멈 hf 생산 화면 diff --git a/ProductFunctionTester/ScopeMoudule.vb b/ProductFunctionTester/ScopeMoudule.vb index 36a45d5..b8acc1c 100644 --- a/ProductFunctionTester/ScopeMoudule.vb +++ b/ProductFunctionTester/ScopeMoudule.vb @@ -1,4 +1,4 @@ -Module ScopeMoudule +Module ScopeMoudule Public myMgr As Ivi.Visa.Interop.ResourceManager Public myscope As Ivi.Visa.Interop.FormattedIO488 @@ -115,23 +115,15 @@ Return "" End Function - 'Private Sub CheckInstrumentErrors() - ' Dim strerrval As String - ' Dim strout As String = "" - - ' myscope.WriteString(":SYSTem:ERRor?") - ' strerrval = myscope.ReadString - ' While Val(strerrval) <> 0 - ' strout = "INST Error: " + strerrval - ' myscope.WriteString(":SYSTem:ERRor?") - ' strerrval = myscope.ReadString - ' End While - - ' If Not strout = "" Then - ' MsgBox(strout, vbExclamation, "INST Error Messages") - ' myscope.FlushWrite(False) - ' myscope.FlushRead() - ' End If - 'End Sub + ''' 스코프 버퍼 초기화. 연결된 경우에만 동작. + Public Sub ScopeClear() + Try + If myscope IsNot Nothing AndAlso myscope.IO IsNot Nothing Then + myscope.IO.Clear() + End If + Catch + ' 연결 해제 등으로 접근 불가 시 무시 + End Try + End Sub End Module diff --git a/ProductFunctionTester/SpectrumModule.vb b/ProductFunctionTester/SpectrumModule.vb index e87c483..654616e 100644 --- a/ProductFunctionTester/SpectrumModule.vb +++ b/ProductFunctionTester/SpectrumModule.vb @@ -1,4 +1,4 @@ -Module SpectrumModule +Module SpectrumModule Private myMgr As Ivi.Visa.Interop.ResourceManager Private mySpec As Ivi.Visa.Interop.FormattedIO488 @@ -77,4 +77,15 @@ Return "" End Function + ''' 스펙트럼 분석기 버퍼 초기화. 연결된 경우에만 동작. + Public Sub SpecClear() + Try + If mySpec IsNot Nothing AndAlso mySpec.IO IsNot Nothing Then + mySpec.IO.Clear() + End If + Catch + ' 연결 해제 등으로 접근 불가 시 무시 + End Try + End Sub + End Module