
err=viScanf(dac, “%d”, &result); | /* Enter integer returned */ |
| /*, returns a 1 when ready to calibrate */ |
if(err < VI_SUCCESS) err_handler(dac, err); | |
} |
|
result = 1; |
|
while (result !=0 && result !=2) |
|
{ |
|
meas_volt=get_voltage (); | /* Get the voltage measurement */ |
err=viPrintf(dac, “CAL%d:VAL:CURR? %f\n”,i,meas_volt); if(err < VI_SUCCESS) err_handler(dac, err);
err=viScanf(dac, “%d”, &result); | /* Enter integer returned */ |
| /* returns a 0 when calibration complete */ |
if(err < VI_SUCCESS) err_handler(dac, err); | |
if (result == 5) | /* Calibration aborted */ |
{ |
|
printf (“Calibration for channel %d aborted\n\n”,i); | |
result = 0; |
|
} |
|
} |
|
} |
|
/*** STORE THE NEW CALIBRATION CONSTANTS | ***/ |
err=viPrintf(dac, “CAL:STOR;*OPC?\n”); | /* Store the new cal constants */ |
if(err < VI_SUCCESS) err_handler(dac, err); |
|
err=(viScanf(dac,"%d",&result); |
|
if(err < VI_SUCCESS) err_handler(dac, err); | |
sys_err(dac); | ∙ |
| |
| ∙ |
| ∙ |
} |
|
Appendix D | Voltage/Current Output Adjustment 164 |