7-4
IM 701730-17E
PostProcces:
Call CloseDevice 'Device Clear
End Function
----------------------------------------------------------------------------------------
Private Sub CloseDevice()
Call TmFinish(Dev)
Dev = -1
End Sub
----------------------------------------------------------------------------------------
Private Sub DisplayError(ByVal id As Long)
Dim ers As String
Dim err As Long
err = TmGetLastError(id) 'Get Error No.
If (err = 2) Then
ers = "Device not found"
ElseIf (err = 4) Then
ers = "Connection to device failed"
ElseIf (err = 8) Then
ers = "Device not connected"
ElseIf (err = 16) Then
ers = "Device already connected"
ElseIf (err = 32) Then
ers = "Incompatible PC"
ElseIf (err = 64) Then
ers = "Illegal parameter"
ElseIf (err = 256) Then
ers = "Send error"
ElseIf (err = 512) Then
ers = "Receive error"
ElseIf (err = 1024) Then
ers = "Received data not block data"
ElseIf (err = 4096) Then
ers = "System error"
ElseIf (err = 8192) Then
ers = "Illegal device ID"
Else
ers = ""
End If
MsgBox ("Error No. " + Str(err) + Chr(13) + ers), vbExclamation, "Error!"
End Sub
----------------------------------------------------------------------------------------
Private Sub Command1_Click()
Dim sts As Long
If (StartFlag = 1) Then
Exit Sub
End If
StartFlag = 1
Text1.Text = "START"
List1.Clear
sts = GpibTdiv 'Run Sample1(GPIB) Set/Get TDIV
If (sts = 0) Then
List1.AddItem Query(0)
End If
Text1.Text = "END"
StartFlag = 0
End Sub
----------------------------------------------------------------------------------------
Private Sub Command2_Click()
Dim sts As Long
If (StartFlag = 1) Then
Exit Sub
End If
StartFlag = 1
Text1.Text = "START"
List1.Clear
sts = GpibGetWord 'Run Sample2(GPIB) Get Word Data
If (sts = 0) Then
List1.AddItem "END"
End If
Text1.Text = "END"
StartFlag = 0
End Sub
----------------------------------------------------------------------------------------
Private Sub Command3_Click()
Dim sts As Integer
If (StartFlag = 1) Then
Exit Sub
End If
StartFlag = 1
Text1.Text = "START"
List1.Clear
sts = GpibGetMeasure 'Run Sample3(GPIB) Get Measure
If (sts = 0) Then
List1.AddItem Query(0)
List1.AddItem Query(1)
List1.AddItem Query(2)
7.3 Initialize/Error/Execute