Chapter 4 Network Architecture and Example Code
65
//|
//+--Indicate the IP Address of ADAM4577 which you want to access
Dst4577Addr.sin_port = htons(5201);
//|
//+-- The UDP port of the serial port on ADAM-4577
// Creat a UDP socket on the local PC
Dst4577Sock = socket(AF_INET, SOCK_DGRAM, 0);
sendto(Dst4577Sock, (char *)"0123456789", 10, 0, (sockaddr
*)&Dst4577Addr, sizeof(Dst4577Addr));
iRecvedAddrLen = sizeof(RecvedAddr);
recvfrom(Dst4577Sock, (char *)RxData, 10, 0, (sockaddr
*)&RecvedAddr, &iRecvedAddrLen);
for(i = 0; i < 10; ++i)
printf("%c ", RxData[i]);
printf("\n");
closesocket(Dst4577Sock);
return 0;
Summary of Contents for ADAM-4577
Page 1: ...ADAM 4577 1 Port Universal Serial Device Gateway User s Manual...
Page 10: ...Tables Table 2 1 ADAM 4577 LED Definition 9...
Page 11: ...1 C hapter Overview...
Page 15: ...2 Getting Started Chapter...
Page 23: ...Chapter 2 Getting Started 13 Figure 2 7 Panel Mounting...
Page 28: ...18 ADAM 4577 User s Manual DB 9 male RS 232 RS 485 RS 422...
Page 30: ...20 ADAM 4577 User s Manual...
Page 31: ...3 Installation and Configuration Chapter...
Page 58: ...48 ADAM 4577 User s Manual Figure 3 15 Command HEX Testing Windows...
Page 60: ...50 ADAM 4577 User s Manual...
Page 61: ...4 Network Architecture and Example Code Chapter...
Page 76: ...66 ADAM 4577 User s Manual...