Position to String
SteveMob
✭
in RobotStudio
Hello,
I have a VAR pos that I am reading the position of the robot with using CPos. I am trying to send that data to LabVIEW from RAPID via Socket communication. However, sockets can only send data or strings. So my question is, is there way to go from Position data to String data? This is some of my code to help visualize:
!(Robot/RAPID is client, LabVIEW is server)
VAR pos Current_Position;
VAR string str;
PROC main()
MoveJ Home,v150,z0,tool0;
WaitTime 2;
!Socket connection/send/receive data.......
!
!
!
!
!
MoveJ myRobtarget,v100,fine\Inpos:=inpos50,tool0,\WObj:=wobj0;
WaitTime 1;
Current_Position :=CPos(\Tool:=tool0,\WObj:=wobj0);
!SocketSend client_socket\Str:=Current_Position;
str:=Strtoval(Current_Position,3);
ELSE
TPWrite "Unhandled command: "\Num:=command;
ENDIF
ENDIF
IF ERRNO>0 THEN
IF ERRNO=ERR_SOCK_TIMEOUT THEN
ELSE
i:=0;
ENDIF
ENDIF
WaitTime 1;
ENDIF
ENDWHILE
ENDPROC
Thanks for any help!
SM
I have a VAR pos that I am reading the position of the robot with using CPos. I am trying to send that data to LabVIEW from RAPID via Socket communication. However, sockets can only send data or strings. So my question is, is there way to go from Position data to String data? This is some of my code to help visualize:
!(Robot/RAPID is client, LabVIEW is server)
VAR pos Current_Position;
VAR string str;
PROC main()
MoveJ Home,v150,z0,tool0;
WaitTime 2;
!Socket connection/send/receive data.......
!
!
!
!
!
MoveJ myRobtarget,v100,fine\Inpos:=inpos50,tool0,\WObj:=wobj0;
WaitTime 1;
Current_Position :=CPos(\Tool:=tool0,\WObj:=wobj0);
!SocketSend client_socket\Str:=Current_Position;
str:=Strtoval(Current_Position,3);
ELSE
TPWrite "Unhandled command: "\Num:=command;
ENDIF
ENDIF
IF ERRNO>0 THEN
IF ERRNO=ERR_SOCK_TIMEOUT THEN
ELSE
i:=0;
ENDIF
ENDIF
WaitTime 1;
ENDIF
ENDWHILE
ENDPROC
Thanks for any help!
SM
Tagged:
0
Categories
- All Categories
- 5.5K RobotStudio
- 394 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 309 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 783 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings