
Remote Control
Users Guide
6-18
}
else
buf[sizeof(buf)-1] = '\0';
strcpy(str,buf);
return strlen(str);
}
/****************************************************************************
**/
int main(int argc,char *argv[])
{
socket_t s;
struct sockaddr_in saddr;
struct sockaddr_in *addr_in = (struct sockaddr_in *)&saddr;
char buffer[1024];
/* socket (TCP/IP) API initialization: */
if ( socket_setup() < 0 )
return 1;
/*
* Connect to the instrument:
*/
/* set destination IP address and TCP port: */
memset(addr_in,0,sizeof(struct sockaddr_in));
addr_in->sin_family = AF_INET;
addr_in->sin_port = htons(PORT);
addr_in->sin_addr.s_addr = inet_addr(HOST);
/* create socket: */
s = socket_create();
if ( !s )
return 1;
#if 0
fprintf(stderr,"socket_connect() ...\n");
#endif
if ( socket_connect(s,(struct sockaddr *)&saddr,sizeof(saddr)) < 0 )
return 1;
#if 0
fprintf(stderr,"socket_connect(): done\n");
#endif
#if 0
if ( socket_puts(s,"*IDN?") < 0 )
return 1;
if ( socket_gets(s,buffer) < 0 )
return 1;
puts(buffer);
#endif
/* Bring the instrument into a default state: */
socket_puts(s,"*RST");
/* Select three wattmeter configuration: */
socket_puts(s,"ROUT:SYST \"3W\"");
Содержание NORMA 4000 Operators
Страница 6: ...Remote Control Users Guide iv ...
Страница 8: ...Remote Control Users Guide vi ...
Страница 10: ...Remote Control Users Guide viii ...
Страница 12: ...Remote Control Users Guide 1 2 Output Unit 1 13 Command Sequence and Command Synchronization 1 14 ...
Страница 26: ...Remote Control Users Guide 2 2 ...
Страница 38: ...Remote Control Users Guide 3 2 ...
Страница 50: ...Remote Control Users Guide 4 2 ...
Страница 150: ...Remote Control Users Guide 4 102 ...
Страница 152: ...Remote Control Users Guide 5 2 ...
Страница 160: ...Remote Control Users Guide 6 2 ...
Страница 184: ...Remote Control Users Guide 6 26 ...