/
**************************************************************************
/
void prt_readng( float32 *read_data ) /* Display readings */
{
int16
i;
printf(“ch reading ch reading ch reading ch reading\n”);
printf(“— —— — — —— - — —— — — —— - — —— — — —— - — —— — — —— -\n”);
for(i = 0; i < 64; i += 4)
{
printf(“%2d %13.6e %2d %13.6e %2d %13.6e %2d %13.6e\n”,
i, read_data[i], i+1, read_data[i+1], i+2, read_data[i+2],
i+3, read_data[i+3]);
}
}
/
*************************************************************************
/
int32 check_error( char *message ) /* Check for module generated errors */
{
int16
error;
char
err_out[256];
/* Check for any errors */
INST_QUERY(e1413, “SYST:ERR?”, “”, &error, err_out);
/* If error is found, print out the error(s) */
if (error)
{
while(error)
{
printf(“Error %d,%s (in function %s)\n”, error, err_out, message);
INST_QUERY(e1413, “SYST:ERR?”, “”, &error, err_out);
}
return 1;
}
return 0;
}
Verifying a Successful Configuration
An example C-SCPI (Compiled-SCPI) program source is shown on the
previous pages. This program is included with your C-SCPI driver tape (file
name verif.cs). The program uses the
*IDN?
query command to verify the
HP Scanning A/D Converter module is operational and responding to
commands. The program also has an error checking function (check_error()).
It is important to include an instrument error checking routine in your
programs, particularly your first trial programs so you get instant feedback
while you are learning about the HP E1313/E1413. After you run the C-SCPI
preprocessor and then compile and load this program, type verif to run the
example.
32 Getting Started
Chapter 1
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com