Agilent Technologies E1564A Stereo Receiver User Manual


 
Configuring the Digitizer Modules 31Chapter 1
/* Set the timeout value to 10 seconds. */
viSetAttribute (digitizer, VI_ATTR_TMO_VALUE, 10000);
/* Reset the module. */
err = viPrintf(digitizer, “*RST\n”);
if (err<VI_SUCCESS) err_handler (digitizer, err);
/* Query for the module’s identification string. */
err = viPrintf(digitizer, “*IDN?\n”);
if (err<VI_SUCCESS) err_handler (digitizer, err);
err = viScanf(digitizer, “%t”, buf);
if (err<VI_SUCCESS) err_handler (digitizer, err);
printf (“Module ID = %s\n\n”, buf);
/* Check the module for system errors. */
err = viPrintf(digitizer, “*SYST:ERR?\n”);
if (err<VI_SUCCESS) err_handler (digitizer, err);
err = viScanf(digitizer, “%t”, buf);
if (err<VI_SUCCESS) err_handler (digitizer, err);
printf (“System error response = %s\n\n”, buf);
viClose (digitizer); /* close the digitizer session */
} /* end of main */
/*** Error handling function ***/
void err_handler (ViSession digitizer, ViStatus err)
{
char buf[1024] = {0};
viStatusDesc (digitizer, err, buf); /* retrieve error description */
printf (“ERROR = %s\n”, buf);
return;
}