Mitsubishi Melsec-L Series User Manual page 283

Ethernet interface module
Hide thumbs Also See for Melsec-L Series:
Table of Contents

Advertisement

printf("\nAJ_test End.\n\n Normally completed. \n");
printf("Press any key to exit the program.\n");
Dmykeyin=getchar(); // Wait for key input
return(SOCK_OK);
}
void Sockerror(int error_kind) // Error handling function
{
if(error_kind==ERROR_INITIAL){
printf("Initial processing is abnormal.");
}
else{
nErrorStatus=WSAGetLastError();
switch(error_kind){
case ERROR_SOCKET:
printf("Failed to create socket.");
break;
case ERROR_BIND:
printf("Failed to bind.");
break;
case ERROR_CONNECT:
printf("Failed to establish connection.");
break;
case ERROR_SEND:
printf("Sending failed.");
break;
case ERROR_RECEIVE:
printf("Receiving failed.");
break;
case ERROR_SHUTDOWN:
printf("Failed to shutdown.");
break;
case ERROR_CLOSE:
printf("Failed to close normally.");
break;
}
}
printf("Error code is %d.\n", nErrorStatus);
if(Closeflag==FLAG_ON){
nErrorStatus=shutdown(socketno,2);
nErrorStatus=closesocket(socketno);
Closeflag=FLAG_OFF;
}
printf("Press any key to exit the program.\n");
Dmykeyin=getchar();
WSACleanup();
return;
}
// Shutdown processing
// Close processing
// Connection completion flag off
// Wait for a key input
// Release Winsock.DLL
APPENDICES
A
281

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec-lj71e71-100

Table of Contents