Example 6, Acquire Binary Trace - Agilent Technologies 86082A User Manual

Wavelength domain component analyzer
Table of Contents

Advertisement

Example 6, Acquire Binary Trace

Description
In Visual Basic, greater performance can be achieved by downloading a trace
as binary (Real32) data. This program benchmarks the advantage by down-
loading the trace as ASCII and Real32, then displays the time it took to accom-
plish each task. The work required to convert the trace from binary to
numbers that Visual Basic can use is also demonstrated.
Program
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Const OPC_TMO = 180
Private Const LZ_TMO = 360
Private Sub cmdAcquireTrace_Click()
'-- VISA session variables
Dim DefRM As Long
Dim DevSessionNum As Long
Dim BinBuffer As String * 65500
Dim ReadBuffer As String * 65500
Dim AscBuffer As String
Dim STB As Integer
Dim Status As Long: Status = 0
Dim ErrMsg As String: ErrMsg = ""
'-- Performance timers for Binary Trace
Dim oBinTraceBench As clsStopWatch
Dim oBinCnvrtBench As clsStopWatch
Dim dBinTraceBench As Double
Dim dBinCnvrtBench As Double
'-- Performance timers for ASCII Trace
Dim oAscTraceBench As clsStopWatch
Dim oAscCnvrtBench As clsStopWatch
Dim dAscTraceBench As Double
Dim dAscCnvrtBench As Double
'-- Misc variables
Dim dBinTrace() As Double
Dim dAscTrace() As Double
Dim numPoints As Integer
Dim TimeStart As Double
Dim msgstr As String
On Error GoTo ErrorHandler
MousePointer = vbHourglass
'-- Create stopwatch objects
Set oBinTraceBench = New clsStopWatch
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com
Remote Operation
Example Programs
'VISA session
'VISA session to device
'Buffer to read back data
'Fixed length strings may not be large
'enough for ASCII downloads
'Status byte
'Holds binary trace values
'Holds ASCII trace values
'Number of points in a trace
'Used to track OPC serial poll timeout
5-61

Advertisement

Table of Contents
loading

Table of Contents