5-80
Remote Operation
Example Programs
’-- Translate error number into a message
Call viStatusDesc(DevSessionNum, Status, ReadBuffer)
’-- Trim off nulls
ErrMsg = TrimVISAStr(ReadBuffer)
InitVISASession = Status
Else
ErrMsg = Err.Number & vbCrLf & Err.Description
End If
End Function
Private Function TrimVISAStr
(ByVal VISAStr As String) As String
Dim Pos As Long
On Error GoTo ErrorHandler
Pos = (InStr(VISAStr, Chr(0))) - 1
If Pos <> -1 Then
TrimVISAStr = Left(VISAStr, Pos)
Else
TrimVISAStr = Trim(VISAStr)
End If
Exit Function
ErrorHandler:
TrimVISAStr = VISAStr
End Function
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com