Example 4, Markers - Agilent Technologies 86082A User Manual

Wavelength domain component analyzer
Table of Contents

Advertisement

Remote Operation
Example Programs

Example 4, Markers

Description
The WDCA is capable of performing bandwidth measurements of the DUT.
This Visual Basic program will demonstrate how easy it is to have the instru-
ment calculate the bandwidth and return the result.
Program
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Const OPC_TMO = 180
Private Const LZ_TMO = 360
Private Sub cmdMarker_Click()
Dim TimeStart As Double
'-- VISA session variables
Dim DefRM As Long
Dim DevSessionNum As Long
Dim ReadBuffer As String * 65500
Dim STB As Integer
Dim Status As Long: Status = 0
Dim ErrMsg As String: ErrMsg = ""
On Error GoTo ErrorHandler
MousePointer = vbHourglass
'-- Call function to initialize a VISA session to the WDCA
Status = InitVISASession(txtGPIB_IN.Text, txtGPIB_PA.Text, DefRM, DevSessionNum, ErrMsg)
If Status <> 0 Or ErrMsg <> "" Then GoTo ErrorHandler
'-- Set Center Wavelength
Status = viVPrintf(DevSessionNum, "SENS:WAV:CENT " & Val(txtCWL.Text) & "nm" & Chr$(10), 0)
If Status <> 0 Then GoTo ErrorHandler
'-- Set Span
Status = viVPrintf(DevSessionNum, "SENS:WAV:SPAN " & Val(txtSpan.Text) & "nm" & Chr$(10), 0)
If Status <> 0 Then GoTo ErrorHandler
'-- Set sensitivity
If chkSensitivityLock.Value = 0 Then
'-- Unlock Sensitivity
Status = viVPrintf(DevSessionNum, "SENS:POW:DC:RANG:LOW:AUTO OFF" & Chr$(10), 0)
If Status <> 0 Then GoTo ErrorHandler
'-- Set Sensitivity
Status = viVPrintf(DevSessionNum, "SENS:POW:DC:RANG:LOW " & Val(txtSensitivity.Text) & _
If Status <> 0 Then GoTo ErrorHandler
Else
'-- Lock Sensitivity
5-48
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com
Chr$(10), 0)
'VISA session
'VISA session to device
'Buffer to read back data
'Status byte

Advertisement

Table of Contents
loading

Table of Contents