Omron CS CJ1W-ETN21 Operation Manual page 194

Sysmac cs and cj series ethernet units construction of applications
Hide thumbs Also See for CS CJ1W-ETN21:
Table of Contents

Advertisement

FINS/UDP Method
170
85
/* RECEIVE
FINS
RESPONSE*/
86
addrlen = sizeof(cs_addr);
87
88
if ((recvlen = recvfrom(sockfd,fins_resp,MAX_MSG,0,&cs_addr,&addrlen)) < 0)
89
{
90
if (errno == EINTR)
91
goto CMND_SEND;
92
err_exit("receive error");
93
}
94
else
95
{
96
alarm(0);
/*
STOP
97
printf("recv length %d¥n",recvlen);
98
99
if (recvlen < 14)
/*
100
err_exit("FINS length error");
101
if ((fins_cmnd[3] != fins_resp[6]) || (fins_cmnd[4] != fins_resp[7]) ||
102
(fins_cmnd[5] != fins_resp[8]) )
103
{ /*
DESTINATION
104
err_exit("illegal source address error");
105
}
106
if(fins_cmnd[9] != fins_resp[9]) /* SID CHECK*/
107
err_exit("illegal SID error");
108
}
109
110
/*
CLOSE
SOCKET*/
111
close(sockfd);
112
113 }
114
115
116 /*
ERROR
PROCESSING
117 *
118 */
119 err_exit(err_msg)
120 char *err_msg;
121 {
122
printf("client: %s %x¥n",err_msg,errno);
123
exit(1);
124 }
125
126 /*
SIGNAL
CAPTURE
127 *
128 */
129 recv_fail()
130 {
131
printf("response timeout error ¥n");
132 }
/*
RE-SEND
FINS
COMMAND*/
RESPONSE
MONITOR
ILLEGAL
RESPONSE
LENGTH
ADDRESS
CHECK*/
FUNCTIONS
FUNCTIONS
Section 7-3
TIMER*/
CHECK*/

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cs cs1w-etn21Sysmac cs1w-etn21Sysmac cj1w-etn21

Table of Contents