Hi
first things first: I am not seriously into robotics, so bare with me…
Im doing a media project where i need to control an irb120 through an already existing RAPID module. The only thing that is not working is the socket stuff inside this module although the socket connection is exactly like shown in the documentation. RAPID editor underlines the complete socket stuff red and says “wrong amount of arguments”. Am i missing anything? Is this a restriction of the trial version? How exactly would i set up a virtual irc5 for offline control?
Thank you for your help!!
bs
PROC ServerCreateAndConnect(string ip, num port)
VAR string clientIP;
SocketCreate serverSocket;
SocketBind serverSocket, ip, port;
SocketListen serverSocket;
TPWrite “SERVER: Server waiting for incoming connections …”;
WHILE SocketGetStatus(clientSocket) <> SOCKET_CONNECTED DO
SocketAccept serverSocket,clientSocket \ClientAddress:=clientIP \Time:=WAIT_MAX;
IF SocketGetStatus(clientSocket) <> SOCKET_CONNECTED THEN
TPWrite “SERVER: Problem serving an incoming connection.”;
TPWrite “SERVER: Try reconnecting.”;
ENDIF
!//Wait 0.5 seconds for the next reconnection
WaitTime 0.5;
ENDWHILE
TPWrite "SERVER: Connected to IP " + clientIP;
ENDPROC