
Programming Examples
U, I, P Measurement over Ethernet Interface without VISA Library
6
6-15
#endif
typedef struct {
socket_handle_t h;
} *socket_t;
/****************************************************************************
**/
static void Delay(double seconds)
{
Sleep((DWORD)(seconds * 1000));
}
/****************************************************************************
**/
void wsa_error(char *func,int error)
{
fprintf(stderr,"%s() failed, error %d\n",
func,error == -1 ? WSAGetLastError() : error);
}
/****************************************************************************
**/
int socket_setup(void)
{
#if WIN
WSADATA wsaData;
int wsaerrno;
/*
* Initialize Windows Socket DLL
*/
if ( (wsaerrno = WSAStartup(
MAKEWORD(1,1), /* at least version 1.1 */
&wsaData)) != 0 )
{
wsa_error("WSAStartup",wsaerrno);
return -1;
}
#endif /* WIN */
return 0; /* OK */
}
/****************************************************************************
**/
int socket_cleanup(void)
{
#if WIN
if ( WSACleanup() == SOCKET_ERROR )
wsa_error("WSACleanup",-1);
#endif
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 ...