Agilent Technologies 86082A User Manual page 219

Wavelength domain component analyzer
Table of Contents

Advertisement

Remote Operation
Example Programs
'-- If an OPC_TMO + 5 minutes goes by, throw a timeout
If (Now * 86400) - TimeStart > OPC_TMO + 300 Then GoTo OPCTimeOut
Else
'-- If a minute goes by, throw a timeout
If (Now * 86400) - TimeStart > OPC_TMO Then GoTo OPCTimeOut
End If
Loop While (STB And 32) <> 32
'-- Clear status information
Status = viVPrintf(DevSessionNum, "*CLS" & Chr$(10), 0)
If Status <> 0 Then GoTo ErrorHandler
Call MsgBox("Normalization complete!", vbOKOnly, "Done")
EndSession:
On Error Resume Next
'-- Close VISA session to the WDCA
Call viClose(DevSessionNum)
'-- End VISA session
Call viClose(DefRM)
MousePointer = vbDefault
Exit Sub
OPCTimeOut:
MousePointer = vbDefault
Call MsgBox("Timeout while waiting for OPC. Make sure all cables are securely fastened.", _
vbOKOnly, "Timeout")
GoTo EndSession
ErrorHandler:
If Err.Number = 0 Then
If Status <> 0 Then
'-- VISA error
MousePointer = vbDefault
'-- Translate error number into a message
Call viStatusDesc(DevSessionNum, Status, ReadBuffer)
'-- Trim off nulls
ErrMsg = TrimVISAStr(ReadBuffer)
'-- Post message and reset vars
Call MsgBox(Status & vbCrLf & ErrMsg, vbOKOnly, "Error")
Status = 0
5-44
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com

Advertisement

Table of Contents
loading

Table of Contents