how to assign data to pos through external files

WuYue
✭
in RobotStudio
Hi,
I am reading the coordinate [x,y,z] from external txt file into an array. My questions are:
1) how to assign the array to pos type? for example, I have input=[1,2,3], and I define VAR pos position; can I use position :=input?
2) as my position is a VAR (variable) already. When I define
VAR pos position;
VAR num input{3};
VAR robtarget Target_20:=[position,[0.499999903,0,0.86602546,0],[0,0,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]];
the program has this error: the expression position is not a constant expression. How can I solve this problem?
Thanks!
Tagged:
0
Comments
-
Hi this may he PROC myTest() VAR pos myPos; VAR num myPosArray{3}:=[1,2,3]; VAR robtarget myTarget; myPos.x:=myPosArray{1}; myPos.y:=myPosArray{2}; myPos.z:=myPosArray{3}; myTarget.trans:=myPos; ENDPROCPer Svensson
Robotics and Vision Specialist
Consat Engineering0 -
Hi, PerSvensson, Thanks for your reply! It works!0
Categories
- All Categories
- 5.6K RobotStudio
- 398 UpFeed
- 20 Tutorials
- 14 RobotApps
- 300 PowerPacs
- 406 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 336 IRC5
- 67 OmniCore
- 8 RCS (Realistic Controller Simulation)
- 828 RAPID Programming
- 12 AppStudio
- 4 RobotStudio AR Viewer
- 19 Wizard Easy Programming
- 107 Collaborative Robots
- 5 Job listings