Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide 131
Programming Examples
LAN Programming Interface Examples
return s;
}
/******************************************************************
*
> $Function: commandInstrument$
*
* $Description: send a SCPI command to the instrument.$
*
* $Parameters: $
* (FILE *) . . . . . . . . . file pointer associated with TCP/IP
socket.
* (const char *command) . . SCPI command string.
* $Return: (char *) . . . . . . a pointer to the result string.
*
* $Errors: returns 0 if send fails $
*
******************************************************************/
int commandInstrument(SOCKET sock,
const char *command)
{
int count;
/* fprintf(stderr, "Sending \"%s\".\n", command); */
if (strchr(command, '\n') == NULL) {
fprintf(stderr, "Warning: missing newline on command %s.\n",
command);
}
count = send(sock, command, strlen(command), 0);
if (count == SOCKET_ERROR) {
Summary of Contents for X-Series
Page 4: ...4 ...
Page 10: ...10 Contents ...