5-24 Agilent 4155C/4156C VXIplug&play Driver User’s Guide, Edition 4
Programming Examples for C++ Users
Multi-Channel Pulsed Spot Measurements
Measurement
Result Example
Ic = 43.357000 mA
Ib = 0.336762 mA
mch[0] = collector; /* 32 */
mch[1] = base;
mch[2] = 0;
mode[0] = 1;
mode[1] = 1;
range[0] = 0;
range[1] = 0;
ret = hp4156b_cmd(vi, "PT 0,0.005,0.01,0,1"); /* 39 */
ret = hp4156b_cmd(vi, "PV 1,0,0,-0.8,0.1");
ret = hp4156b_force(vi, base, hp4156b_VF_MODE, 0, vb, ibcomp, 0); /* 41 */
ret = hp4156b_force(vi, collector, hp4156b_VF_MODE, 0, vc, iccomp, 0);
check_err (vi, ret); /* 43 */
ret = hp4156b_startMeasure(vi, hp4156b_MM_PSPOT, mch, mode, range,
hp4156b_FLAG_OFF);
ret = hp4156b_zeroOutput(vi, hp4156b_CH_ALL); /* 45 */
check_err (vi, ret);
ret = hp4156b_readData(vi, &eod, &type, &mdata, &stat, &ch); /* 47 */
md[0]=mdata;
st[0]=stat;
ret = hp4156b_readData(vi, &eod, &type, &mdata, &stat, &ch);
md[1]=mdata;
st[1]=stat;
check_err (vi, ret);
printf("Ic = %9.6f mA\n", md[0] * 1000);
printf("Ib = %9.6f mA\n", md[1] * 1000);
ret = hp4156b_setSwitch(vi, hp4156b_CH_ALL, 0); /* 56 */
check_err (vi, ret);
}
Line Description
32 to 38 Defines the value for the variables used for the measurement channel.
39 to 40 Sets the pulse source timing parameters and voltage output parameters.
41 to 42 Applies voltage to device.
44 Performs multi channel pulsed spot measurement.
45 Sets the specified port to the zero output state.
47 to 55 Reads the measurement data, and displays the result.
56 Disables all ports.
43, 46, 53 and 57 Calls the check_err subprogram (shown in Table 5-1) to check if an error status is
returned for the previous line.
58 End of the perform_meas subprogram.