
Programming Examples
U, I, P Measurement over Ethernet Interface without VISA Library
6
6-17
wsa_error("recv",-1);
return -1;
}
#endif
return l;
}
/****************************************************************************
**/
int socket_send(socket_t s,void *buf,int len,int flags)
{
register int slen; /* sent length */
#if WIN
slen = send(s->h,buf,len,flags);
if ( slen == SOCKET_ERROR )
{
wsa_error("send",-1);
return -1;
}
#endif
return slen;
}
/****************************************************************************
**/
int socket_puts(socket_t s,char *str)
{
char buf[1024];
strcpy(buf,str);
strcat(buf,"\n");
if ( socket_send(s,buf,strlen(buf),0) < 0 )
return -1;
return 0;
}
/****************************************************************************
**/
int socket_gets(socket_t s,char *str)
{
char buf[1024];
char *p;
if ( socket_recv(s,buf,sizeof(buf),0) < 0 )
return -1;
if ( (p = memchr(buf,'\n',sizeof(buf))) != NULL )
{
if ( p > buf && p[-1] == '\r' )
p--;
*p = '\0';
Summary of Contents for NORMA 4000 Operators
Page 6: ...Remote Control Users Guide iv ...
Page 8: ...Remote Control Users Guide vi ...
Page 10: ...Remote Control Users Guide viii ...
Page 26: ...Remote Control Users Guide 2 2 ...
Page 38: ...Remote Control Users Guide 3 2 ...
Page 50: ...Remote Control Users Guide 4 2 ...
Page 150: ...Remote Control Users Guide 4 102 ...
Page 152: ...Remote Control Users Guide 5 2 ...
Page 160: ...Remote Control Users Guide 6 2 ...
Page 184: ...Remote Control Users Guide 6 26 ...