Agilent Technologies 86082A User Manual page 239

Wavelength domain component analyzer
Table of Contents

Advertisement

Remote Operation
Example Programs
Status = viVPrintf(DevSessionNum, "FORM:DATA ASCII" & Chr$(10), 0)
If Status <> 0 Then GoTo ErrorHandler
'-- Time data transfer
Call oAscTraceBench.StopWatch(swStart)
'-- Make the ASCII buffer extra large for downloading a lot of trace points
AscBuffer = Space(170000)
'-- 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", AscBuffer)
If Status <> 0 Then GoTo ErrorHandler
Call oAscTraceBench.StopWatch(swStop, dAscTraceBench)
'-- Time how long it takes to translate the data
Call oAscCnvrtBench.StopWatch(swStart)
'-- Send out query to get the number of sweep points
Status = viVPrintf(DevSessionNum, "SENS:SWE:POIN?" & Chr$(10), 0)
If Status <> 0 Then GoTo ErrorHandler
'-- Read the number of trace points from the buffer
Status = viVScanf(DevSessionNum, "%t", ReadBuffer)
If Status <> 0 Then GoTo ErrorHandler
'-- Shave off end nulls and convert to integer
numPoints = CInt(TrimVISAStr(ReadBuffer))
'-- Parse comma-delimited array string
Status = modConvert.ASCToArray(AscBuffer, numPoints, dAscTrace, ErrMsg)
If Status <> 0 Then Call Err.Raise(Status, "ASCToArray", ErrMsg)
Call oAscCnvrtBench.StopWatch(swStop, dAscCnvrtBench)
'-- Display benchmark results
msgstr = "Binary Results:" & vbCrLf & _
"Trace Xfer = " & dBinTraceBench & "ms" & vbCrLf & _
"Trace Cnvrt = " & dBinCnvrtBench & "ms" & vbCrLf & vbCrLf & _
"ASCII Results:" & vbCrLf & _
"Trace Xfer = " & dAscTraceBench & "ms" & vbCrLf & _
"Trace Cnvrt = " & dAscCnvrtBench & "ms" & vbCrLf & vbCrLf & _
"Number of Points = " & numPoints
Call MsgBox(msgstr, vbOKOnly, "Done")
EndSession:
On Error Resume Next
'-- Free objects
Set oBinTraceBench = Nothing
5-64
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com

Advertisement

Table of Contents
loading

Table of Contents