Mitsubishi Electric QJ71E71-100 User Manual page 416

Q corresponding ethernet interface module
Table of Contents

Advertisement

// System B send processing
if( (CloseflagB == FLAG_ON) && (SendFlag == FLAG_OFF) ){
if(send(socketnoB, (char*)(s_buf), length, 0) != SOCKET_ERROR) {
}else{
}
}
// Send completion processing
if( SendFlag == FLAG_OFF ){
Sockerror(ERROR_SEND, ERROR_SEND);
return (SOCK_NG);
}
if(CloseflagA == FLAG_ON) {
ShutdownflagA = FLAG_OFF;
if(shutdown(socketnoA, 2) != SOCK_OK) { // Send/receive inhibit processing (System A)
}
}
if(CloseflagB == FLAG_ON) {
ShutdownflagB = FLAG_OFF;
if(shutdown(socketnoB, 2) != SOCK_OK) { // Send/receive inhibit processing (System B)
}
}
CloseflagA = FLAG_OFF;
if(closesocket(socketnoA) != SOCK_OK) {
Sockerror(ERROR_CLOSE, ERROR_NO_ERROR);
return (SOCK_NG);
}
CloseflagB = FLAG_OFF;
if(closesocket(socketnoB) != SOCK_OK) {
Sockerror(ERROR_NO_ERROR, ERROR_CLOSE);
return (SOCK_NG);
}
(To the next page)
414
printf("\n Send data (System B) \n%s\n", s_buf); // Send data display (System B)
SendFlag = FLAG_ON;
if(DataRecv(socketnoB, r_bufB, RECV_ANS_1) == TRUE) { // Data receive
printf("\n Receive data (System B) \n%s\n", r_bufB); // Receive data display
} else {
printf("Receive failure (System B) \n");
}
printf("Send failure (System B) \n");
Sockerror(ERROR_SHUTDOWN, ERROR_NO_ERROR);
return (SOCK_NG);
Sockerror(ERROR_NO_ERROR, ERROR_SHUTDOWN);
return (SOCK_NG);
// Data send (System B)
// Send completion flag ON
// Receive processing
// Error handling
// Shutdown flag OFF
// Error handling
// Shutdown flag OFF
// Error handling
// Connection end flag OFF
// Close processing (System A)
// Error handling
// Connection end flag OFF
// Close processing (System B)
// Error handling

Advertisement

Table of Contents
loading

This manual is also suitable for:

Qj71e71-b5Qj71e71-b2

Table of Contents