Agilent Technologies E1418A User Manual page 166

8/16-channel d/a converter module scpi programming guide
Table of Contents

Advertisement

/***
VOLTAGE OUTPUT ADJUSTMENT
for (i=1;i<num_chan+1;i++)
result = 1;
while (result !=0)
}
/***
CURRENT OUTPUT ADJUSTMENT
/*** set the calibration resistor value
result = 0;
while (result < 1)
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++)
164
Voltage/Current Output Adjustment
{
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);
if(err < VI_SUCCESS) err_handler(dac, err);
}
{
meas_volt=get_voltage ();
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);
if(err < VI_SUCCESS) err_handler(dac, err);
if (result == 5)
{
printf ("Calibration for channel %d aborted\n",i);
result = 0;
}
}
{
err=viPrintf(dac, "CAL:CONF:RES?\n");
if(err < VI_SUCCESS) err_handler(dac, err);
err=viScanf(dac, "%d", &result);
if(err < VI_SUCCESS) err_handler(dac, err);
}
{
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);
***/
/* Enter integer returned */
/* returns a 1 when ready to calibrate */
/* Get the voltage measurement */
/* Enter integer returned */
/* returns a 0 when calibration complete */
/* Calibration for this channel aborted */
***/
***/
/* Configure for resistance calibration */
/* Enter integer returned */
/* returns a 1 when ready to calibrate */
Appendix D

Advertisement

Table of Contents
loading

Table of Contents