Agilent Technologies 86082A User Manual page 211

Wavelength domain component analyzer
Table of Contents

Advertisement

Remote Operation
Example Programs
'-- Turn trace update on
Status = viVPrintf(DevSessionNum, "TRAC:FEED:CONT " & cmbTrace.Text & ",ALW" & Chr$(10), 0)
If Status <> 0 Then GoTo ErrorHandler
'-- Make trace visible on the display
Status = viVPrintf(DevSessionNum, "DISP:WIND:TRAC:STAT " & cmbTrace.Text & ",1" & Chr$(10), 0)
If Status <> 0 Then GoTo ErrorHandler
'-- Take a sweep and send OPC
Status = viVPrintf(DevSessionNum, "INIT:IMM;*OPC" & Chr$(10), 0)
If Status <> 0 Then GoTo ErrorHandler
'-- Wait for completion
TimeStart = Now * 86400
Do
Call Sleep(5) 'Delay so the instrument isn't tied up with responding to STB
DoEvents
'-- Check bit 5 of the status byte register to see if the operation is complete
Status = viReadSTB(DevSessionNum, STB)
If Status <> 0 Then GoTo ErrorHandler
'-- Check bit 7 to see if a lambda zero is taking place
If (STB And 128) = 128 Then
'-- 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
'-- Download results
'-- Send query to acquire Trace A
Status = viVPrintf(DevSessionNum, "TRAC? TRA" & Chr$(10), 0)
If Status <> 0 Then GoTo ErrorHandler
'-- Read the trace from the buffer
Status = viVScanf(DevSessionNum, "%t", ReadBuffer)
If Status <> 0 Then GoTo ErrorHandler
5-36
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com
'Used to track elapsed time

Advertisement

Table of Contents
loading

Table of Contents