Thanks,
vishi
"Siabevef" wrote in message
news:50650000000500000085C80000-1042324653000@exchange.ni.com...
> Good Mornig Vishi.
>
> First thing is my English is very bad, but I try help you.
>
> You can use WSAStatup in CVI , because this function is defined in the
> SDK of Cvi .The functions you need ar defined in the WSock32.lib of
> SDK . In this SDK you have all functions that you need for implement
> your communications with your device.
>
> For Example , this is the code to open a UDP Comunications:
>
>
>
//--------------------------------------------------------------------------
--------
> // OPEN A UDP COMUNICATIONS
> int OpenUDP(int iNumberPort, int *HandleSocket)
> {
> SOCKADDR_IN sin;
> WORD wVersionRequested;
> WSADATA wsaData;
> int errorUDP, t = 1;
> unsigned long u = 0;
>
> wVersionRequested = MAKEWORD(1, 1);
> if((errorUDP = WSAStartup(wVersionRequested, &wsaData)) !=
> 0) {
> WSACleanup();
> return errorUDP;
> }
>
> //OPEN A SOCKET
> *HandleSocket = socket(AF_INET, SOCK_DGRAM,0);
> if(*HandleSocket == INVALID_SOCKET)
> {
> errorUDP = WSAGetLastError();
> fclosesocket(*HandleSocket);
> WSACleanup();
> }
>
> sin.sin_family = AF_INET;
> sin.sin_addr.s_addr = htonl(INADDR_ANY); // sin.sin_port =
> htons(iNumPort);
> if((errorUDP = bind(*HandleSocket, (LPSOCKADDR)&sin,
> sizeof(sin))) != 0) /
> {
> errorUDP = WSAGetLastError();
> closesocket(*HandleSocket);
> WSACleanup();
> return errorUDP;
> }
>
> ioctlsocket(*HandleSocket, FIONBIO, &u);
>
> setsockopt(*HandleSocket, SOL_SOCKET, SO_BROADCAST, (char*)&t,
> sizeof(int));
> return 0;
> }
>
> If you need a Help to implement the rest of functions tell me to:
>
> f.bermejo.garapen@adegi.es
>
> Tximis