Agilent 4155C/4156C VXIplug&play Driver User’s Guide, Edition 4 3-45
Programming Examples for Visual Basic Users
Staircase Sweep with Pulsed Bias Measurements
Dim d_vg As Double ’secondary sweep step value (delta) ’49
If nop2 = 1 Then
d_vg = 0
Else
d_vg = (vg2 - vg1) / (nop2 - 1)
End If
Dim vg As Double ’secondary sweep source output
vg = vg1
Dim width As Double ’58
Dim period As Double
Dim p_hold As Double
width = 0.001
period = 0.01
p_hold = 0.1
i = 0 ’array counter for sweepIv returned data
For j = 1 To nop2 ’array counter for secondary sweep output data ’65
dvg(j - 1) = vg
ret = hp4156b_setPbias(vi, m(1), hp4156b_VF_MODE, 0, 0, vg, width, period, p_hold, igcomp)
ret = hp4156b_setIv(vi, m(0), hp4156b_SWP_VF_SGLLIN, 0, vd1, vd2, nop1, hold, delay,
s_delay, idcomp, p_comp)
ret = hp4156b_sweepPbias(vi, m(0), hp4156b_IM_MODE, 0, rep, sc(i), md(i), st(i))
check_err vi, ret
vg = vg + d_vg
If rep = nop1 Then ’73
i = i + nop1
Else
msg = rep & " measurement steps were returned. It must be " & nop1 & " steps."
MsgBox msg, vbOKOnly, ""
ret = hp4156b_zeroOutput(vi, hp4156b_CH_ALL)
GoTo Bottom_sub
End If ’80
Next j
ret = hp4156b_zeroOutput(vi, hp4156b_CH_ALL)
save_data nop1, nop2, dvg(), md(), st(), sc(), vi, ret, m()
Bottom_sub:
End Sub ’85
Line Description
49 to 56 Declares variables, and defines the value. They are used for the secondary sweep
source, d_vg is the step value and vg is the output value.
67 to 70 Sets the pulsed source, sets the voltage sweep source, and performs the staircase
sweep with pulsed bias measurement. After that, calls the check_err subprogram
(shown in Table 3-1) to check if an error status is returned for the previous line.
73 to 80 Disables the channels and stops the program execution if the number of returned
data is not equal to the nop1 value.
82 to 83 Sets all channels to zero output state, and calls the save_data subprogram (next
page) to save measurement data.
85 End of the sweep_meas subprogram.