Mitsubishi Electric QJ71E71-100 User Manual page 405

Q corresponding ethernet interface module
Table of Contents

Advertisement

hostdata.sin_family=AF_INET;
hostdata.sin_port=sc.my_port;
hostdata.sin_addr.s_addr=sc.my_addr.s_addr;
if(bind(socketno,(LPSOCKADDR)&hostdata,sizeof(hostdata))!=SOCK_OK){
Sockerror(ERROR_BIND);
return(SOCK_NG);
}
aj71e71.sin_family=AF_INET;
aj71e71.sin_port=sc.aj_port;
aj71e71.sin_addr.s_addr=sc.aj_addr.s_addr;
if(connect(socketno,(LPSOCKADDR)&aj71e71,sizeof(aj71e71))!=SOCK_OK){
Sockerror(ERROR_CONNECT);
return(SOCK_NG);
}
Closeflag=FLAG_ON;
// Set to non-blocking mode
ulCmdArg = 1;
ioctlsocket(socketno, FIONBIO, &ulCmdArg);
//
strcpy((char *)(s_buf), "03FF000A4420000000000500112233445566778899AA");
strcpy((char *)(s_buf),"500000FF03FF00002C000A14010000D
length = strlen((char *)(s_buf));
if(send(socketno, (char *)(s_buf), length, 0) == SOCKET_ERROR) {
Sockerror(ERROR_SEND);
return (SOCK_NG);
}
printf("\n send data\n%s\n",s_buf);
(To the next page)
// Bind
// Error handling
// Connection (Active open)
// Error handling
// Connection completion flag ON
// Set to non-blocking mode
// D0 to D4 batch write request (1E frame)
*0000000005112233445566778899AA");
// D0 to D4 batch write request (3E frame)
// Data sending
// Error handling
APPENDICES
A
403

Advertisement

Table of Contents
loading

This manual is also suitable for:

Qj71e71-b5Qj71e71-b2

Table of Contents