ABB工业机器人ConnectionRoutine部分
程序员文章站
2024-01-04 08:29:16
...
PROC ConnectionRoutine()
VAR string clientAddress;
SocketClose serverSocket;
SocketClose clientSocket;
SocketCreate serverSocket;
SocketBind serverSocket,"192.168.10.10", 6000;
SocketListen serverSocket;
SocketAccept serverSocket, clientSocket\Time:=WAIT_MAX;
TPWrite clientAddress + " connected to " + "192.168.10.10";
!AccSet 70, 100;
ERROR
IF ERRNO = ERR_SOCK_CLOSED THEN
ReconnectAfterErrors;
RETRY;
ENDIF
ENDPROC