Agilent Technologies E4406A VSA manual Programming Examples, Using C Programming Over Socket LAN

Models: E4406A VSA

1 406
Download 406 pages 63.49 Kb
Page 161
Image 161
Manual background

Programming Examples

Using C Programming Over Socket LAN

*+0,"No error"

*Don’t bother decoding.

******************************************************************/

if (strncmp(result_str, "+0,", 3) == 0) { /* Matched +0,"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)

{

Chapter 3

161

Page 161
Image 161
Agilent Technologies E4406A VSA manual Programming Examples, Using C Programming Over Socket LAN, Chapter