5-10 Agilent 4155C/4156C VXIplug&play Driver User’s Guide, Edition 4
Programming Examples for C++ Users
Multi-Channel Spot Measurements
Measurement
Result Example
Ic = 3.846500 mA
Ib = 0.018970 mA
hfe = 202.767528
mch[0] = collector; /* 31 */
mch[1] = base;
mch[2] = 0;
mode[0] = 1;
mode[1] = 1;
range[0] = 0;
range[1] = 0;
/* 38 */
ret = hp4156b_force(vi, emitter, hp4156b_VF_MODE, 0, 0, 0.1, 0);
ret = hp4156b_force(vi, base, hp4156b_VF_MODE, 0, vb, ibcomp, 0);
ret = hp4156b_force(vi, collector, hp4156b_VF_MODE, 0, vc, iccomp, 0);
check_err (vi, ret); /* 42 */
ret = hp4156b_measureM(vi, mch, mode, range, &md[0], &st[0]);
check_err (vi, ret); /* 45 */
ret = hp4156b_zeroOutput(vi, hp4156b_CH_ALL); /* 47 */
check_err (vi, ret); /* 48 */
printf("Ic = %8.6f mA\n", md[0] * 1000);
printf("Ib = %8.6f mA\n", md[1] * 1000);
printf("hfe = %10.6f \n", md[0]/md[1]); /* 52 */
ret = hp4156b_setSwitch(vi, hp4156b_CH_ALL, 0); /* 54 */
check_err (vi, ret); /* 55 */
}
Line Description
31 to 37 Defines the value for the variables used for the measurement channel.
39 to 41 Applies voltage to device.
44 Performs multi channel spot measurement.
47 Sets the specified port to the zero output state.
50 to 52 Displays the measurement result data.
54 Disables all ports.
42, 45, 48 and 55 Calls the check_err subprogram (shown in Table 5-1) to check if an error status is
returned for the previous line.
56 End of the perform_meas subprogram.