138 Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide
Programming Examples
LAN Programming Interface Examples
> $Function: showErrors$
*
* $Description: Query the SCPI error queue, until empty. Print
results. $
*
* $Return: (void)
*
******************************************************************/
void showErrors(SOCKET sock)
{
const char * command = "SYST:ERR?\n";
char result_str[256];
do {
queryInstrument(sock, command, result_str,
sizeof(result_str)-1);
/******************************************************************
* Typical result_str:
* -221,"Settings conflict; Frequency span reduced."
* +0,"No error"
* Don't bother decoding.
******************************************************************/
if (strncmp(result_str, "+0,", 3) == 0) {
/* M0,"No error" */
break;
}
puts(result_str);
} while (1);
}
Содержание X-Series
Страница 4: ...4 ...
Страница 10: ...10 Contents ...