Herunterladen Inhalt Inhalt Diese Seite drucken

Mitsubishi Electric MELSEC System Q Bedienungsanleitung Seite 446

Speicher programmierbare steuerungen
Vorschau ausblenden Andere Handbücher für MELSEC System Q:
Inhaltsverzeichnis

Werbung

Programmbeispiel für ein verbundenes Gerät
printf(„\nAJ_test End.\n\n Nor mally com pleted. \n");
printf(„Press any key to exit the pro gram.\n");
Dmykeyin=getchar();
return(SOCK_OK);
}
void Sockerror(int error_kind)
{
if(error_kind==ERROR_INI TIAL){
}
else{
}
printf(„Error code is %d.\n", nErrorStatus);
if(Closeflag==FLAG_ON){
}
printf(„Press any key to exit the pro gram.\n");
Dmykeyin=getchar();
WSACleanup();
return;
}
A - 56
printf(„Ini tial pro cess ing is abnor mal.");
nErrorStatus=WSAGetLastError();
switch(error_kind){
case ERROR_SOCKET:
printf(„Failed to cre ate socket.");
break;
case ERROR_BIND:
printf(„Failed to bind.");
break;
case ERROR_CON NECT:
printf(„Failed to estab lish con nec tion.");
break;
case ERROR_SEND:
printf(„Send ing failed.");
break;
case ERROR_RECEIVE:
printf(„Receiv ing failed.");
break;
case ERROR_SHUT DOWN:
printf(„Failed to shut down.");
break;
case ERROR_CLOSE:
printf(„Failed to close nor mally.");
break;
}
nErrorStatus=shut down(socketno,2);
nErrorStatus=closesocket(socketno);
Closeflag=FLAG_OFF;
// Wait for key input
// Error han dling func tion
// Shut down pro cess ing
// Close pro cess ing
// Con nec tion com ple tion flag off
// Wait for a key input
// Release Winsock.DLL
MITSUBISHI ELECTRIC
An hang

Werbung

Inhaltsverzeichnis
loading

Diese Anleitung auch für:

Qj71e71-b2Qj71e71-b5Qj71e71-100

Inhaltsverzeichnis