socket communication?
Hello,
I have robot with IRC5 controller with option:socket messaging,and I want the robot change it's path by read data from pc via socket. does the following code works? Thanks!
Module Socket
VAR socketdev temp_socket;
VAR socketdev client_socket;
VAR string received_string;
VAR num received_nX;
VAR num received_nY;
VAR num received_nZ;
SocketCreat temp_socket;
SocketBind temp_socket,"192.168.125.2",5000;
SocketListen temp_socket;
!waiting for a connection request
SocketAccept temp_socket , client_socket;
SocketClose temp_socket;
SocketReceive client_socket Str:=received_string;
SocketReceive client_socket
X:=received_nX;
SocketReceive client_socket
Y:=received_nY;
SocketReceive client_socket
Z:=received_nZ;
SocketSend client_socket Str:="Hello client";
VAR num nX :=0;
VAR num nY :=0;
VAR num nZ :=0;
CONST robtarget pOffset:=[[1803.34,-515.97,1673.73],[0.000106,0.719759,0.694225,0.000419],[-1,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
MoveL Offs(pOffset,nX,nY,nZ),v150,fine,tCurrent;
MoveL Offs(pOffset,nX,nY,nZ),v150,fine,tCurrent;
MoveL Offs(pOffset,nX,nY,nZ),v150,fine,tCurrent;
MoveL Offs(pOffset,nX,nY,nZ),v150,fine,tCurrent;
ENDMODULE
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 316 IRC5
- 63 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 801 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings