beautypg.com

Agilent Technologies N5183A MXG User Manual

Page 129

background image

Agilent N518xA, E8663B, E44x8C, and E82x7D Signal Generators Programming Guide

119

Programming Examples

LAN Programming Interface Examples

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 be a more specific so that

*/

/* marker value querys 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 signal generator does the query internally, and uses the result.

*/

query++ ; /* bump past '?' */

while (*query)

{

if (*query == ' ') /* attempt to ignore white spc */

query++ ;

else break ;

}

This manual is related to the following products: