Chapter 7 7-17
Programming Examples
Measurement Setup Examples
‘***************************************************************************
‘* hp875x Instrument Driver EXAMPLE #1A *
‘* *
‘* This program demonstrates setup of various measurement parameters such *
‘* as start frequency, stop frequency, etc. The program first selects one *
‘* type of measurement to be viewed using dual-channel display format. *
‘* The specified start and stop frequencies are then programmed and the *
‘* analyzer display is autoscaled. The program concludes by displaying *
‘* four types of measurements simultaneously. *
‘***************************************************************************
Private Sub cmdExecute_Click()
Dim vi As Long
Dim err_status As Long
Dim nwa As String
Dim retString As String
Dim msg As String
Dim f_start As Double
Dim f_stop As Double
Dim iRetVal As Integer
Dim reply As Integer
lstText.Clear
lstText.AddItem “Example 1a --”
lstText.AddItem “This program demonstrates setup of various measurement parameters
such”
lstText.AddItem “as start frequency, stop frequency, etc. The program first selects
one”
lstText.AddItem “type of measurement to be viewed using dual-channel display format.”
lstText.AddItem “The specified start and stop frequencies are then programmed and the”
lstText.AddItem “analyzer display is autoscaled. The program concludes by displaying”
lstText.AddItem “four types of measurements simultaneously.”
lstText.AddItem ““
nwa = “GPIB0::16::INSTR”
‘ Initialize the instrument
Call initialize(nwa, VI_FALSE, VI_TRUE, vi)
‘ Set the timeout to 3000 msec (3 sec)
err_status = hp875x_timeOut(vi, 3000)
Call checkErr(vi, err_status)
‘ Set up measurement and display
‘ Channel 1
err_status = hp875x_channelSelect(vi, hp875x_CH1)
Call checkErr(vi, err_status)
‘ Turn auxiliary channel off.
err_status = hp875x_auxChannel(vi, hp875x_CH1, hp875x_OFF)
Call checkErr(vi, err_status)
‘ Return Loss measurement, no parameter conversion
‘ For 8719ET/8720ET/8722ET/8753ET, hp875x_S_PAR11 is interpreted as hp875x_REFL
err_status = hp875x_measType(vi, hp875x_S_PAR11, hp875x_CONV_OFF)
Call checkErr(vi, err_status)
‘ Log magnitude display
err_status = hp875x_displaySelect(vi, hp875x_CH1, hp875x_DISP_DATA, hp875x_DISP_LOGM)