Keysight E4428C ESG RF Programming Manual page 137

Signal generators
Table of Contents

Advertisement

memcpy(&peeraddr_in.sin_addr.s_addr, hostPtr->h_addr, hostPtr->h_length);
peeraddr_in.sin_family = AF_INET;
peeraddr_in.sin_port = htons((unsigned short)portNumber);
if (connect(s, (const struct sockaddr*)&peeraddr_in,
sizeof(struct sockaddr_in)) == SOCKET_ERROR)
{
fprintf(stderr,"unable to create socket to '%s': %s\n",
hostname, strerror(errno));
return INVALID_SOCKET;
}
return s;
}
/***************************************************************************
*
> $Function: commandInstrument$
*
* $Description:
send a SCPI command to the instrument.$
*
* $Parameters:
$
*
(FILE *) . . . . . . . . . file pointer associated with TCP/IP socket.
*
(const char *command)
* $Return:
(char *) . . . . . . a pointer to the result string.
*
* $Errors:
returns 0 if send fails $
*
***************************************************************************/
int commandInstrument(SOCKET sock,
{
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);
Keysight Signal Generators Programming Guide
. . SCPI command string.
const char *command)
LAN Programming Interface Examples
*/
Programming Examples
129

Advertisement

Table of Contents
loading

Table of Contents