Agilent 4155C/4156C VXIplug&play Driver User’s Guide, Edition 4 5-13
Programming Examples for C++ Users
Staircase Sweep Measurements
printf(" Vg (V), Vd (V), Id (mA)\n");
/* 72 */
for (j = 0; j < nop2; j++){
n = j * nop1;
for (i = n; i < n + nop1; i++){
printf(" %4.2f, %4.2f, %9.6f \n", dvg[j], sc[i], md[i] * 1000);
}
}
/* 79 */
FILE *stream;
/* 81 */
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 (j = 0; j < nop2; j++){
n = j * nop1;
for (i = n; i < n + nop1; i++){
fprintf( stream, "%4.2f, %4.2f, %9.6f, %d\n", dvg[j], sc[i], md[i] * 1000,
st[i]);
}
}
printf( "%s%c", msg2, c );
}
if( fclose( stream ) ){
printf( "Data file was not closed\n" );
}
/* 100 */
ret = hp4156b_setSwitch(vi, hp4156b_CH_ALL, 0);
/* 102 */
check_err (vi, ret);
}
Line
Description
72 to 79
Displays the measurement result data.
81 to 100
Saves the measurement results into a file (C:\Agilent\data\data1.txt, CSV file).
102
Disables all ports.
103
Calls the check_err subprogram (shown in Table 5-1) to check if an error status is
returned for the previous line.
105
End of the perform_meas subprogram.
Summary of Contents for 4155C
Page 3: ......
Page 13: ...1 Installation...
Page 19: ...2 Driver Function Reference...
Page 89: ...3 Programming Examples for Visual Basic Users...
Page 147: ...4 Programming Examples for Visual Basic NET Users...
Page 183: ...5 Programming Examples for C Users...
Page 225: ...6 Programming Examples for VEE Users...