4-28 Agilent B1500 VXIplug&play Driver User’s Guide, Edition 3
Programming Examples for C++ Users
Multi Channel Sweep Measurement
Measurement
Result Example
Vb (V), Ic (mA), Ib (mA), hfe, Tc (sec), Tb (sec), Status_c,
Status_b
0.25, -0.005000, -0.000005, 1000.000000, 0.058700, 0.058700, 0, 0
0.30, -0.005000, -0.000005, 1000.000000, 0.061000, 0.061000, 0, 0
0.35, -0.005000, -0.000015, 333.333333, 0.063000, 0.063000, 0, 0
0.40, 0.000000, -0.000005, 0.000000, 0.065000, 0.065000, 0, 0
0.45, -0.005000, 0.000005, -1000.000000, 0.067000, 0.067000, 0, 0
0.50, 0.000000, 0.000005, 0.000000, 0.068900, 0.068900, 0, 0
0.55, 0.010000, 0.000085, 117.647059, 0.070500, 0.070500, 0, 0
0.60, 0.085000, 0.000475, 178.947368, 0.072400, 0.072400, 0, 0
0.65, 0.595000, 0.003035, 196.046129, 0.074400, 0.074400, 0, 0
0.70, 3.825000, 0.018935, 202.006866, 0.076400, 0.076400, 0, 0
0.75, 18.740000, 0.096725, 193.745154, 0.078400, 0.078400, 0, 0
ViChar f_name[] = "C:\\Agilent\\ex\\data5.txt"; /* 71 */
ViChar head1[] = "Vb (V), Ic (mA), Ib (mA), hfe, Tc (sec), Tb (sec), Status_c,
Status_b";
ViChar msg1[] = "Saving data...";
ViChar msg2[] = "Data save completed.";
ViChar c = ’\n’;
FILE *stream;
if( ( stream = fopen( f_name, "w+" )) == NULL ){
printf( "Data file was not opened\n" );
}
else {
printf( "%s%c", msg1, c );
fprintf( stream, "%s%c", head1, c );
for (i = 0; i < nop; i++){
fprintf( stream, "%4.2f, %9.6f, %9.6f, %12.6f, %8.6f, %8.6f, %d, %d\n", sc[i],
md[2*i] * 1000, md[2*i+1] * 1000, md[2*i]/md[2*i+1], tm[2*i], tm[2*i+1], st[2*i],
st[2*i+1]);
}
printf( "%s%c", msg2, c );
}
if( fclose( stream ) ){
printf( "Data file was not closed\n" );
}
} /* 93 */
Line Description
71 to 92 Saves the measurement results into a CSV file specified by the f_name variable.
93 End of the perform_meas subprogram.