Agilent 4155C/4156C VXIplug&play Driver User’s Guide, Edition 4 3-11
Programming Examples for Visual Basic Users
Multi-Channel Spot Measurements
Sub mspot_meas(vi As Long, ret As Long, pins() As Long) ’1
Dim vc As Double ’3
Dim vb As Double
Dim ve As Double
Dim iccomp As Double
Dim ibcomp As Double
Dim iecomp As Double
ve = 0
iecomp = 0.1
vb = 0.7
ibcomp = 0.01
vc = 3
iccomp = 0.1
Dim mch(3) As Long ’16
mch(0) = pins(2) ’collector
mch(1) = pins(1) ’base
mch(2) = 0
Dim mode(2) As Long
mode(0) = 1 ’current measurement
mode(1) = 1 ’current measurement
Dim range(2) As Double
range(0) = 0 ’auto range
range(1) = 0 ’auto range
Dim md(2) As Double ’27
Dim st(2) As Long
ret = hp4156b_force(vi, pins(0), hp4156b_VF_MODE, 0, ve, iecomp, 0) ’30
ret = hp4156b_force(vi, pins(1), hp4156b_VF_MODE, 0, vb, ibcomp, 0)
ret = hp4156b_force(vi, pins(2), hp4156b_VF_MODE, 0, vc, iccomp, 0)
ret = hp4156b_measureM(vi, mch(0), mode(0), range(0), md(0), st(0))
check_err vi, ret
ret = hp4156b_zeroOutput(vi, hp4156b_CH_ALL) ’36
display_data md(), st(), vi, ret, pins()
End Sub
Line Description
1 Beginning of the mspot_meas subprogram.
3 to 28 Declares variables used in the subprogram, and defines the value.
30 to 35 Applies voltage to device, and performs the multi channel spot 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.
36 Sets the specified port to the zero output state.
37 Calls the display_data subprogram (next page) to display measurement data.
38 End of the mspot_meas subprogram.