Agilent Technologies 86082A User Manual page 238

Wavelength domain component analyzer
Table of Contents

Advertisement

'-- 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
'-- If a minute goes by, throw a timeout
If (Now * 86400) - TimeStart > OPC_TMO Then GoTo OPCTimeOut
'-- 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
Call Sleep(5) 'Delay so the instrument isn't tied up with responding to STB
DoEvents
Loop While (STB And 32) <> 32
'-- Clear status information. NOTE: This is required for *OPC to work again!
Status = viVPrintf(DevSessionNum, "*CLS" & Chr$(10), 0)
If Status <> 0 Then GoTo ErrorHandler
'---- Download results as Binary ----
'-- Format data as REAL32
Status = viVPrintf(DevSessionNum, "FORM:DATA REAL,32" & Chr$(10), 0)
If Status <> 0 Then GoTo ErrorHandler
'-- Time the data transfer
Call oBinTraceBench.StopWatch(swStart)
'-- Send query to acquire Trace
Status = viVPrintf(DevSessionNum, "TRAC? " & cmbTrace.Text & Chr$(10), 0)
If Status <> 0 Then GoTo ErrorHandler
'-- Read the trace from the buffer
Status = viVScanf(DevSessionNum, "%t", BinBuffer)
If Status <> 0 Then GoTo ErrorHandler
Call oBinTraceBench.StopWatch(swStop, dBinTraceBench)
'-- Time how long it takes to translate the data
Call oBinCnvrtBench.StopWatch(swStart)
Status = modConvert.BinASCToArray(BinBuffer, eREAL32, dBinTrace, ErrMsg)
If Status <> 0 Then Call Err.Raise(Status, "BinASCToArray", ErrMsg)
Call oBinCnvrtBench.StopWatch(swStop, dBinCnvrtBench)
'---- Download results as ASCII ----
'-- Format data as ASCII
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com
'Used to track elapsed time
Remote Operation
Example Programs
5-63

Advertisement

Table of Contents
loading

Table of Contents