Agilent 4155C/4156C VXIplug&play Driver User’s Guide, Edition 4 5-19
Programming Examples for C++ Users
Multi-Channel Sweep Measurements
ret = hp4156b_setSwitch(vi, emitter, 1); /* 39 */
ret = hp4156b_setSwitch(vi, base, 1);
ret = hp4156b_setSwitch(vi, collector, 1);
check_err (vi, ret); /* 42 */
ret = hp4156b_force(vi, emitter, hp4156b_VF_MODE, 0, ve, iecomp, 0); /* 44 */
ret = hp4156b_force(vi, collector, hp4156b_VF_MODE, 0, vc, iccomp, 0);
ret = hp4156b_setIv(vi, base, hp4156b_SWP_VF_SGLLIN, 0, vb1, vb2, nop, hold, delay,
s_delay, ibcomp, pcomp);
check_err (vi, ret); /* 48 */
ret = hp4156b_sweepMiv(vi, mch, mode, range, &rep, &sc[0], &md[0], &st[0]);
check_err (vi, ret); /* 51 */
ret = hp4156b_zeroOutput(vi, hp4156b_CH_ALL); /* 53 */
ret = hp4156b_setSwitch(vi, hp4156b_CH_ALL, 0);
check_err (vi, ret); /* 55 */
if ( rep != nop ) { /* 57 */
printf ("%d measurement steps were returned.\nIt must be %d steps.\n", rep, nop);
exit (ret);
}
Line Description
39 to 41 Enables measurement channels.
44 to 45 Applies voltage to device.
47 Sets the staircase sweep source.
50 Performs measurement by using the hp4156b_sweepMiv function.
53 Sets the specified port to the zero output state.
54 Disables all ports.
42, 48, 51, and 55 Calls the check_err subprogram (shown in Table 5-1) to check if an error status is
returned for the previous line.
57 to 60 Stops the program execution if the number of returned data is not equal to the nop
value.