Agilent 4155C/4156C VXIplug&play Driver User’s Guide, Edition 4 3-25
Programming Examples for Visual Basic Users
Multi-Channel Sweep Measurements
ret = hp4156b_setInteg(vi, hp4156b_INTEG_TBL_SHORT, 0.0001, 2) ’48
check_err vi, ret
ret = hp4156b_force(vi, m(2), hp4156b_VF_MODE, 0, ve, iecomp, 0) ’51
ret = hp4156b_force(vi, m(1), hp4156b_VF_MODE, 0, vc, iccomp, 0)
ret = hp4156b_setIv(vi, m(0), hp4156b_SWP_VF_SGLLIN, 0, vb1, vb2, nop, hold, delay,
s_delay, ibcomp, pcomp)
check_err vi, ret
ret = hp4156b_sweepMiv(vi, mch(0), mode(0), range(0), rep, sc(0), md(0), st(0))
check_err vi, ret
ret = hp4156b_zeroOutput(vi, hp4156b_CH_ALL) ’59
Dim msg As String
If rep = nop Then ’62
save_data nop, md(), st(), sc(), vi, ret, m()
Else
msg = rep & " measurement steps were returned. It must be " & nop & " steps."
MsgBox msg, vbOKOnly, ""
End If ’67
End Sub ’69
Line Description
48 Sets the A/D converter integration time.
51 to 52 Applies voltage to device.
53 Sets the staircase sweep source.
56 Performs multi channel sweep measurement.
59 Sets the specified port to the zero output state.
49, 54, and 57 Calls the check_err subprogram (shown in Table 3-1) to check if an error status is
returned for the previous line.
62 to 67 Calls the save_data subprogram to save measurement data. Or, displays a message
box if the number of returned data is not equal to the nop value.
69 End of the sweep_meas subprogram.