Agilent 4155C/4156C VXIplug&play Driver User’s Guide, Edition 4 3-29
Programming Examples for Visual Basic Users
Pulsed Spot Measurements
Sub spot_meas(vi As Long, ret As Long, pins() As Long) ’1
Dim vd As Double ’3
Dim vg As Double
Dim idcomp As Double
Dim igcomp As Double
Dim base As Double
Dim width As Double
Dim period As Double
Dim hold As Double
vd = 0.5
idcomp = 0.05
vg = 0.5
igcomp = 0.01
base = 0
width = 0.001
period = 0.01
hold = 0.1
Dim meas As Double
Dim status As Long ’20
ret = hp4156b_setFilter(vi, pins(1), hp4156b_FLAG_OFF) ’22
ret = hp4156b_setPbias(vi, pins(1), hp4156b_VF_MODE, 2, base, vg, width, period,
hold, igcomp)
ret = hp4156b_force(vi, pins(3), hp4156b_VF_MODE, 0, 0, 0.05, 0)
ret = hp4156b_force(vi, pins(2), hp4156b_VF_MODE, 0, 0, 0.05, 0)
ret = hp4156b_force(vi, pins(0), hp4156b_VF_MODE, 2, vd, idcomp, 0)
ret = hp4156b_measureP(vi, pins(0), hp4156b_IM_MODE, 0, meas, status) ’27
check_err vi, ret
ret = hp4156b_zeroOutput(vi, hp4156b_CH_ALL) ’30
display_data meas, status, vi, ret, pins()
End Sub
Line Description
1 Beginning of the spot_meas subprogram.
3 to 20 Declares variables used in this subprogram, and defines the value.
22 to 23 Sets the SMU filter off for the pulsed bias channel, and set the pulsed bias source.
24 to 26 Applies voltage to device.
27 to 28 Performs the pulsed spot measurement, and calls the check_err subprogram (shown
in Table 3-1) to check if an error status is returned for the previous line.
30 Sets the specified port to the zero output state.
31 Calls the display_data subprogram (next page) to display measurement data.
32 End of the spot_meas subprogram.