4-42 Agilent B1500 VXIplug&play Driver User’s Guide, Edition 3
Programming Examples for C++ Users
Sampling Measurement
ret = agb1500_setSwitch(vi, t1, 1); /* 30 */
ret = agb1500_setSwitch(vi, t2, 1);
ret = agb1500_setSwitch(vi, low, 1);
ret = agb1500_setFilter(vi, agb1500_CH_ALL, agb1500_FLAG_ON);
ret = agb1500_setAdc(vi, agb1500_HRESOLN_ADC, agb1500_INTEG_MANUAL, 2,
agb1500_FLAG_OFF);
check_err (vi, ret); /* 35 */
ret = agb1500_setSample(vi, bias_h, base_h, interval, nop); /* 37 */
ret = agb1500_addSampleSyncIv(vi, t1, agb1500_VF_MODE, 0, base, bias, icomp);
ret = agb1500_addSampleSyncIv(vi, t2, agb1500_VF_MODE, 0, base, bias, icomp);
ret = agb1500_force(vi, low, agb1500_VF_MODE, 0, vlout, ilcomp, 0);
check_err (vi, ret); /* 41 */
ret = agb1500_sampleIv(vi, mch, mode, range, &point, &index[0], &value[0],
&status[0], 0);
check_err (vi, ret);
ret = agb1500_zeroOutput(vi, agb1500_CH_ALL); /* 46 */
check_err (vi, ret);
if ( point != nop ) { /* 49 */
printf ("%d measurement data were returned.\nIt must be %d data.\n", point,
nop);
ret = agb1500_clearSampleSync(vi);
ret = agb1500_setSwitch(vi, agb1500_CH_ALL, 0);
check_err (vi, ret);
exit (ret);
}
Line Description
30 to 32 Enables source and measurement channels.
33 Sets the SMU filter to ON for all output channels.
34 Sets the integration time of the measurement channel’s A/D converter.
35, 41, 44,
47, and 53
Calls the check_err subprogram (shown in Table 4-1) to check if an error status is
returned for the previous line.
37 to 40 Sets the sampling timing parameters and constant voltage sources. And applies 0 V to
the low terminal of devices.
43 Performs sampling measurement.
46 Sets all channels to the zero output state.
49 to 55 Stops the program execution if the number of returned data is not equal to the nop value.