1. 모델별 config 파일 생성 및 적용
2. 지그 연결이 끊어지는 경우 다시 한번 자동으로 RETRY 3. 세모 플러스 검사 추가 4. EP 검사(3번)마다 장치 설정 따로 할 수 있도록 설정 화면 수정 5. 스코프, 스펙트럼 통신 중 발생할 수 있는 오류 최소화 하기 위해 중간에 장치 버퍼 CLEAR 추가 6. 버전 2.2.4
This commit is contained in:
parent
1cedc93a66
commit
e32a0b90d6
6418
ProductFunctionTester/Main_Form.Designer.vb
generated
6418
ProductFunctionTester/Main_Form.Designer.vb
generated
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -116,14 +116,10 @@
|
||||
<Reference Include="Google.Protobuf, Version=3.6.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Google.Protobuf.3.6.1\lib\net45\Google.Protobuf.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Interop.bpac">
|
||||
<HintPath>C:\Program Files\Brother bPAC3 SDK\Samples\VBNET\NamePlt\bin\x64\Release\Interop.bpac.dll</HintPath>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</Reference>
|
||||
<Reference Include="Ivi.Visa.Interop, Version=5.11.0.0, Culture=neutral, PublicKeyToken=a128c98f1d7717c1, processorArchitecture=AMD64">
|
||||
<Reference Include="Ivi.Visa.Interop, Version=8.0.0.0, Culture=neutral, PublicKeyToken=a128c98f1d7717c1, processorArchitecture=AMD64">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
<HintPath>C:\Windows\assembly\GAC_64\Ivi.Visa.Interop\5.11.0.0__a128c98f1d7717c1\Ivi.Visa.Interop.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\Windows\assembly\GAC_64\Ivi.Visa.Interop\8.0.0.0__a128c98f1d7717c1\Ivi.Visa.Interop.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="K4os.Compression.LZ4, Version=1.1.11.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\K4os.Compression.LZ4.1.1.11\lib\net46\K4os.Compression.LZ4.dll</HintPath>
|
||||
|
||||
@ -7,34 +7,47 @@ Module ScopeMoudule
|
||||
Public Function ScopeOpen(ScopeID As String, timeoutNum As Integer) As String
|
||||
|
||||
Try
|
||||
ScopeClear()
|
||||
|
||||
If ScopeID = "" Then
|
||||
Return "FAIL"
|
||||
End If
|
||||
myMgr = New Ivi.Visa.Interop.ResourceManager
|
||||
myscope = New Ivi.Visa.Interop.FormattedIO488
|
||||
|
||||
myscope.IO = myMgr.Open(ScopeID)
|
||||
myscope.IO.Clear()
|
||||
myscope.IO.Timeout = timeoutNum
|
||||
|
||||
DrainDeviceOutput()
|
||||
strQueryResult = DoQueryString("*IDN?")
|
||||
Debug.Print("Identification string: " + strQueryResult)
|
||||
|
||||
Return strQueryResult
|
||||
Catch ex As System.Runtime.InteropServices.COMException
|
||||
Debug.Print("ErrorCode 값: " & ex.ErrorCode)
|
||||
Debug.Print("ErroMassage 값: " & ex.Message.ToString)
|
||||
Debug.Print("HResult 값: " & ex.HResult)
|
||||
Return "FAIL"
|
||||
Catch ex As Exception
|
||||
Return "FAIL"
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function ScopeRunCk() As Boolean
|
||||
''계측기 쪽 버퍼 비우기
|
||||
Public Sub DrainDeviceOutput(Optional readTimeoutMs As Integer = 200)
|
||||
Dim prevTimeout As Integer = myscope.IO.Timeout
|
||||
Try
|
||||
strQueryResult = DoQueryString("*IDN?")
|
||||
If InStr(strQueryResult, "KEYSIGHT") > 0 Then
|
||||
Return False
|
||||
Else
|
||||
Return True
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Return True
|
||||
myscope.IO.Timeout = readTimeoutMs
|
||||
Dim s As String = myscope.ReadString
|
||||
Debug.Print("남아있는 데이터: " + s)
|
||||
Do While Not String.IsNullOrWhiteSpace(s)
|
||||
s = myscope.ReadString
|
||||
Loop
|
||||
Catch
|
||||
checkError()
|
||||
Finally
|
||||
myscope.IO.Timeout = prevTimeout
|
||||
End Try
|
||||
End Function
|
||||
End Sub
|
||||
|
||||
|
||||
Public Function DoCommand(command As String) As String
|
||||
Dim errStr As String
|
||||
@ -53,15 +66,6 @@ Module ScopeMoudule
|
||||
|
||||
End Function
|
||||
|
||||
' Public Sub DoCommand(command As String)
|
||||
' On Error GoTo VisaComError
|
||||
' myscope.WriteString(command)
|
||||
' CheckInstrumentErrors()
|
||||
' Exit Sub
|
||||
|
||||
'VisaComError:
|
||||
' MsgBox("VISA COM Error: " + vbCrLf + CStr(Err.Number) + ", " + Err.Source + "," + Err.Description, vbExclamation, "VISA COM Error")
|
||||
' End Sub
|
||||
|
||||
Public Function DoQueryString(query As String) As String
|
||||
Dim errStr As String
|
||||
@ -76,28 +80,20 @@ Module ScopeMoudule
|
||||
Return DoQueryString
|
||||
|
||||
Catch ex As Exception
|
||||
Try
|
||||
DrainDeviceOutput()
|
||||
Catch
|
||||
End Try
|
||||
Return "VISA COM Error: " + vbCrLf + CStr(Err.Number) + ", " + Err.Source + "," + Err.Description
|
||||
End Try
|
||||
|
||||
End Function
|
||||
|
||||
' Public Function DoQueryString(query As String) As String
|
||||
' Dim errStr As String
|
||||
' On Error GoTo VisaComError
|
||||
' myscope.WriteString(query)
|
||||
' DoQueryString = myscope.ReadString
|
||||
' CheckInstrumentErrors()
|
||||
' Return DoQueryString
|
||||
'VisaComError:
|
||||
' MsgBox("VISA COM Error: " + vbCrLf + CStr(Err.Number) + ", " + Err.Source + "," + Err.Description, vbExclamation, "VISA COM Error")
|
||||
' Return "FAIL"
|
||||
' End Function
|
||||
|
||||
Private Function CheckInstrumentErrors() As String
|
||||
Dim strerrval As String
|
||||
Dim strout As String = ""
|
||||
|
||||
myscope.WriteString(":SYSTem:ERRor?")
|
||||
Try
|
||||
myscope.WriteString(":SYSTem:ERRor?")
|
||||
strerrval = myscope.ReadString
|
||||
While Val(strerrval) <> 0
|
||||
strout = "INST Error: " + strerrval
|
||||
@ -112,9 +108,30 @@ Module ScopeMoudule
|
||||
Return strout
|
||||
End If
|
||||
|
||||
Return ""
|
||||
Return ""
|
||||
|
||||
Catch ex As Exception
|
||||
Main_Form.txbWindow.AppendText("Error check Message Error:" & ex.Message & vbCrLf)
|
||||
Return ex.Message
|
||||
End Try
|
||||
|
||||
End Function
|
||||
|
||||
Private Sub checkError()
|
||||
Dim strerrval As String
|
||||
Try
|
||||
myscope.WriteString(":SYSTem:ERRor?")
|
||||
strerrval = myscope.ReadString
|
||||
While Val(strerrval) <> 0
|
||||
myscope.WriteString(":SYSTem:ERRor?")
|
||||
strerrval = myscope.ReadString
|
||||
End While
|
||||
Catch ex As Exception
|
||||
Main_Form.txbWindow.AppendText("VISA BUFFER CLEAR ERROR:" & ex.Message & vbCrLf)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
|
||||
''' <summary>스코프 버퍼 초기화. 연결된 경우에만 동작.</summary>
|
||||
Public Sub ScopeClear()
|
||||
Try
|
||||
|
||||
@ -6,25 +6,47 @@ Module SpectrumModule
|
||||
|
||||
Public Function SpecOpen(SpecID As String, ToCount As Integer) As String
|
||||
Try
|
||||
SpecClear()
|
||||
myMgr = New Ivi.Visa.Interop.ResourceManager
|
||||
mySpec = New Ivi.Visa.Interop.FormattedIO488
|
||||
|
||||
mySpec.IO = myMgr.Open(SpecID)
|
||||
mySpec.IO.Clear()
|
||||
mySpec.IO.Timeout = ToCount
|
||||
SpecDrainDeviceOutput(200)
|
||||
|
||||
strQueryRes = SpecQueryStr("*IDN?")
|
||||
|
||||
Return strQueryRes
|
||||
|
||||
Catch ex As System.Runtime.InteropServices.COMException
|
||||
Debug.Print("ErrorCode 값: " & ex.ErrorCode)
|
||||
Debug.Print("ErroMassage 값: " & ex.Message)
|
||||
Debug.Print("HResult 값: " & ex.HResult)
|
||||
Return "FAIL"
|
||||
Catch ex As Exception
|
||||
Return "FAIL"
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Sub SpecDrainDeviceOutput(Optional readTimeoutMs As Integer = 200)
|
||||
Dim prevTimeout As Integer = mySpec.IO.Timeout
|
||||
Try
|
||||
mySpec.IO.Timeout = readTimeoutMs
|
||||
Dim s As String = mySpec.ReadString
|
||||
Do While Not String.IsNullOrWhiteSpace(s)
|
||||
s = mySpec.ReadString
|
||||
Loop
|
||||
Catch
|
||||
' 타임아웃/에러 시 그만 둠
|
||||
Finally
|
||||
mySpec.IO.Timeout = prevTimeout
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Public Function RunCommand(command As String) As String
|
||||
Dim errStr As String
|
||||
Try
|
||||
mySpec.IO.Clear()
|
||||
SpecDrainDeviceOutput(200)
|
||||
mySpec.WriteString(command)
|
||||
errStr = CheckError()
|
||||
If errStr.Replace(" ", "") <> "" Then
|
||||
@ -41,6 +63,8 @@ Module SpectrumModule
|
||||
Public Function SpecQueryStr(query As String) As String
|
||||
Dim errStr As String
|
||||
Try
|
||||
mySpec.IO.Clear()
|
||||
SpecDrainDeviceOutput(200)
|
||||
mySpec.WriteString(query)
|
||||
SpecQueryStr = mySpec.ReadString
|
||||
errStr = CheckError()
|
||||
@ -58,8 +82,8 @@ Module SpectrumModule
|
||||
Private Function CheckError() As String
|
||||
Dim strerrval As String
|
||||
Dim strout As String = ""
|
||||
|
||||
mySpec.WriteString(":SYSTem:ERRor?")
|
||||
Try
|
||||
mySpec.WriteString(":SYSTem:ERRor?")
|
||||
strerrval = mySpec.ReadString
|
||||
While Val(strerrval) <> 0
|
||||
strout = "INST Error: " + strerrval
|
||||
@ -74,7 +98,12 @@ Module SpectrumModule
|
||||
Return strout
|
||||
End If
|
||||
|
||||
Return ""
|
||||
Return ""
|
||||
|
||||
Catch ex As Exception
|
||||
Main_Form.txbWindow.AppendText("Error check Message Error:" & ex.Message & vbCrLf)
|
||||
Return ex.Message
|
||||
End Try
|
||||
End Function
|
||||
|
||||
''' <summary>스펙트럼 분석기 버퍼 초기화. 연결된 경우에만 동작.</summary>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user