Mitsubishi Electric CR800 Series Ethernet Function Instruction Manual page 144

Electric industrial robot
Hide thumbs Also See for CR800 Series:
Table of Contents

Advertisement

4 Appendix
}
counter++;
retry=0;
}
else {
cout << "... Receive Timeout! <Push [Enter] to stop the program>" << endl;
retry--;
if(retry==0) loop=0;
}
} /* while(retry) */
} /* while(loop) */
// End
cout << "/// End /// ";
sprintf(buf, "counter = %ld", counter);
cout << buf << endl;
// Close socket
status=closesocket(destSocket);
if (status == SOCKET_ERROR)
cerr << "ERROR: closesocket unsuccessful" << endl;
status=WSACleanup();
if (status == SOCKET_ERROR)
cerr << "ERROR: WSACleanup unsuccessful" << endl;
return 0;
}
4-24
if(loop==1) {
memcpy(&pls_now, &MXTrecv.dat.pls, sizeof(PULSE));
loop = 2;
}
if(disp) {
PULSE *l=(PULSE*)DispData;
sprintf(buf, "Receive (%ld): TCount=%d
Type(PULSE/OTHER)=%d¥n %ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld (%s)"
,MXTrecv.CCount,MXTrecv.TCount,DispType
,l->p1, l->p2, l->p3, l->p4, l->p5, l->p6, l->p7, l->p8, str);
cout << buf << endl;
}
break;
case MXT_TYP_NULL:
if(loop==1) {
loop = 2;
}
if(disp) {
sprintf(buf, "Receive (%ld): TCount=%d Type(NULL)=%d¥n (%s)"
,MXTrecv.CCount,MXTrecv.TCount, DispType, str);
cout << buf << endl;
}
break;
default:
cout << "Bad data type.¥n" << endl;
break;
// Count up only when communication is successful
// Leave reception loop
// Reception timeout
// No. of retries subtraction
// End program if No. of retries is 0

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cr751 seriesCr750 series

Table of Contents