
150
Chapter 3
Programming Examples
Using C Programming Over Socket LAN
/******************************************************************
* 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);
}
/***************************************************************************
*
> $Function: isQuery$
*
* $Description: Test current SCPI command to see if it a query. $
*
* $Return: (unsigned char) . . . non-zero if command is a query. 0 if not.
*
***************************************************************************/
unsigned char isQuery( char* cmd )
{
unsigned char q = 0 ;
char *query ;
/*********************************************************/
/* if the command has a '?' in it, use queryInstrument. */
/* otherwise, simply send the command. */
/* Actually, we must a little more specific so that */
/* marker value queries are treated as commands. */
/* Example: SENS:FREQ:CENT (CALC1:MARK1:X?) */
/*********************************************************/
if ( (query = strchr(cmd,'?')) != NULL)
{
/* Make sure we don't have a marker value query, or
* any command with a '?' followed by a ')' character.
* This kind of command is not a query from our point of view.
* The analyzer does the query internally, and uses the result.
*/
query++ ; /* bump past '?' */
while (*query)
{
if (*query == ' ') /* attempt to ignore white spc */
query++ ;
else break ;
}
if ( *query != ')' )
Содержание E4406A VSA Series
Страница 4: ...4 ...
Страница 59: ...59 2 Programming Fundamentals ...
Страница 76: ...76 Chapter2 Programming Fundamentals Using the Instrument Status Registers Overall Status Register System ...
Страница 124: ...124 Chapter2 Programming Fundamentals Using the LAN to Control the Analyzer ...
Страница 125: ...125 3 Programming Examples ...
Страница 164: ...164 Chapter3 Programming Examples Using Java Programming Over Socket LAN ...
Страница 165: ...165 4 Programming Command Cross References ...
Страница 379: ...379 6 Error Messages ...
Страница 412: ...412 Chapter6 Error Messages Error Message Descriptions ...