2-42 Agilent B1500 VXIplug&play Driver User’s Guide, Edition 3
Driver Functions
agb1500_sampleIv
Example ViSession vi;
ViStatus ret;
ViInt32 mch[3]; /* measurement channels */
mch[0] = 1;
mch[1] = 2;
mch[2] = 0;
ret = agb1500_setSwitch(vi, mch[0], 1);
ret = agb1500_setSwitch(vi, mch[1], 1);
ViReal64 h_bias = 0.1; /* bias hold time */
ViReal64 h_base = 0.1; /* base hold time */
ViReal64 intvl = 0.01; /* sampling interval */
ViInt32 pts = 11; /* point */
ViInt32 om = 2; /* output mode: voltage */
ViReal64 or = 0; /* output range: auto */
ViReal64 v1 = 0; /* base voltage */
ViReal64 v2 = 1.5; /* bias voltage */
ViReal64 icomp = 0.1; /* current compliance */
ret = agb1500_setSample(vi, h_bias, h_base, intvl, pts);
ret = agb1500_setSampleMode(vi, agb1500_SAMPLE_LINEAR);
ret = agb1500_addSampleSyncIv(vi, mch[0], om, or, v1, v2, icomp);
ret = agb1500_addSampleSyncIv(vi, mch[1], om, or, v1, v2, icomp);
ret = agb1500_resetTimestamp(vi);
ViInt32 mm[2]; /* measurement mode */
ViReal64 mr[2]; /* measurement range */
mm[0] = 1; /* current mode for mch[0] */
mm[1] = 1; /* current mode for mch[1] */
mr[0] = 0; /* auto range for mch[0] */
mr[1] = 0; /* auto range for mch[1] */
ViInt32 mpts; /* number of measurement steps */
ViReal64 idx[11]; /* data index */
ViReal64 md[22]; /* measurement data */
ViInt32 st[22]; /* status */
ViReal64 tm[22]; /* time stamp data */
ret = agb1500_sampleIv(vi, mch, mm, mr, &mpts, &idx[0], &md[0],
&st[0],&tm[0]);
For the above example, the array variables idx[], md[], st[], and tm[] will contain the
following data.
idx[n]: Data index.
md[2*n]: Data (current) measured by the mch[0] channel.
md[2*n+1]: Data (current) measured by the mch[1] channel.
st[2*n]: Status for the md[2*n] data.
st[2*n+1]: Status for the md[2*n+1] data.
tm[2*n]: Time stamp data for the md[2*n] data.
tm[2*n+1]: Time stamp data for the md[2*n+1] data.
where, n = 0 to 10 (integer).