HP E1418A User Manual

Page 164

Advertising
background image

/*** VOLTAGE OUTPUT ADJUSTMENT ***/
for

(i=1;i<num_chan+1;i++)

{

result = 0;

while (result < 1)

{

err=viPrintf(dac, “CAL%d:CONF:VOLT?\n”,i); /* Configure for calibration */
if(err < VI_SUCCESS) err_handler(dac, err);
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)

{
meas_volt=get_voltage ();

/* Get the voltage measurement */

err=viPrintf(dac, “CAL%d:VAL:VOLT? %f\n”,i,meas_volt); /* Send the measurement*/
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 for this channel aborted */

{
printf (“Calibration for channel %d aborted\n”,i);
result = 0;
}

}

}

/*** CURRENT OUTPUT ADJUSTMENT ***/

/*** set the calibration resistor value ***/

result = 0;
while (result < 1)

{
err=viPrintf(dac, “CAL:CONF:RES?\n”);

/* Configure for resistance calibration */

if(err < VI_SUCCESS) err_handler(dac, err);
err=viScanf(dac, “%d”, &result);

/* Enter integer returned */
/* returns a 1 when ready to calibrate */

if(err < VI_SUCCESS) err_handler(dac, err);
}

meas_res = get_resistance();
err=viPrintf(dac, “CAL:VAL:RES %f\n”,meas_res); /* Send the resistance value */
if(err < VI_SUCCESS) err_handler(dac, err);

/*** channel current output adjustment ***/

for (i=1;i<num_chan+1;i++)

{
result = 0;
while (result < 1)

{
err=viPrintf(dac, “CAL%d:CONF:CURR? \n”,i); /* Configure for calibration */
if(err < VI_SUCCESS) err_handler(dac, err);

163 Voltage/Current Output Adjustment

Appendix D

Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com

Advertising