/* Read returned data * /
iread(addr, into, length, NULL, &actual);
/* NULL terminates result string and print the results * /
if (actual)
{
into[actual - 1] = (char) 0;
printf(“ \n%s” , into);
}
/* Close communication * /
iclose(addr);
/* Release SICL resource allocation; not needed for Windows NT * /
_siclcleanup();
}
Example to Read Formatted Data
To read formatted data, replace the “iread” function in the above program with the “iscanf” function.
/* Read returned data * /
iscanf(addr, “ %t” , into);
/*Print the results */
printf(“ \n%s” , into);
Example to Send and Read Formatted Data
To send and read formatted data, replace the “iscanf” and “iprintf” functions with the “ipromptf” function.
/* Send SCPI command and read returned data * /
ipromptf(addr, “ SYSTem:ERRor?\n” , “ %t” , into);
Sending SCPI Commands 2-9