Agilent 4155C/4156C VXIplug&play Driver User’s Guide, Edition 4 3-15
Programming Examples for Visual Basic Users
Staircase Sweep Measurements
Dim d_vg As Double ’secondary sweep step value (delta) ’46
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 ’54
i = 0 ’array counter for sweepIv returned data ’56
For j = 1 To nop2 ’array counter for secondary sweep output data
dvg(j - 1) = vg
ret = hp4156b_force(vi, m(1), hp4156b_VF_MODE, 0, vg, igcomp, 0)
ret = hp4156b_setIv(vi, m(0), hp4156b_SWP_VF_SGLLIN, 0, vd1, vd2, nop1, hold,
delay, s_delay, idcomp, p_comp)
ret = hp4156b_sweepIv(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 ’64
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
Next j ’72
ret = hp4156b_zeroOutput(vi, hp4156b_CH_ALL)
save_data nop1, nop2, dvg(), md(), st(), sc(), vi, ret, m() ’75
Bottom_sub:
End Sub
Line Description
46 to 54 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.
56 to 72 Performs the staircase sweep measurement (MOSFET Id-Vd characteristics).
59 to 62 Applies voltage to device, and sets the voltage sweep source. And performs the
staircase sweep 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.
64 to 71 Displays a message box to notify error, disables the source outputs, and stops the
program execution if the number of returned data is not equal to the nop1 value.
75 Calls the save_data subprogram (next page) to save measurement data.
78 End of the sweep_meas subprogram.