User`s manual
Action.Text = "The program generated the following error(s):"
’ Show error message
ShowErr.AddItem Work
’ Loop until error message is 0
Do
’ Read error message
Call iwrite(Addr, ByVal "SYSTem:ERRor?" + Chr$(10), 14, 1, Actual)
Call iread(Addr, ByVal RdErr, 256, 0, Actual)
’ Store message only into Work string
Work = Mid$(RdErr, 1, Actual - 1)
’ Get error number
ErrNum = Val(Work)
’ If error, show error message
If ErrNum <> 0 Then
Work = Work + " - in Sub " + SubName
ShowErr.AddItem Work
End If
Loop Until (ErrNum = 0)
’ Close communication with instrument
Call iclose(Addr)
’ Clean up sicl
Call siclcleanup
’ Press to exit
DispErr = "The program detected errors in sub/function: " + SubName + Chr$(10)
DispErr = DispErr + Chr$(10) + ShowErr + "Press " + Chr$(34) + "OK" + Chr$(34) + " to exit!"
MsgBox DispErr, 64, "sw_vbs: CheckError"
End
End If
ChkName = TempName
End Sub
Sub CmdExe (Cmd() As String)
’ This sub sends SCPI commands
Dim Cnt As Integer
Dim Actual As Long
Continued on Next Page
34 Getting Started Chapter 1