Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide 139
Programming Examples
LAN Programming Interface Examples
/******************************************************************
*
> $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)
{
Summary of Contents for X-Series
Page 4: ...4 ...
Page 10: ...10 Contents ...