call large number of robtargets

Tobias
✭
in RobotStudio
Dear Community,
I am dealing with a very large number robtargets in many paths. I want to modify all of them. I changed the declaration from CONST to PERS as I need the modifications (e.g. point_10.trans.x:=point_10.trans.x + 5.32) to be permanent in the code. But how can I call all those robtargets (point_10 ... point_10000) of a path with a single for-loop? Should be something like
var num number:=20
for number ...
point_"+number+".
number:=number+10
endfor
Thanks a lot.
0
Comments
-
Hi,You need to use something like the below to be able use a variable with a Robtarget name.VAR Robtarget TempRobtarget;PERS Robtarget Point10;PERS Robtarget Point20;PROC PosChange()FOR i FROM 10 to 20 STEP 10 DOGetDataVal "Point"+ValToStr(i), TempRobTarget;TempRobTarget.trans.x:= TempRobTarget.trans.x+20;SetDataVal"Point"+ValToStr(i), TempRobTarget;ENDFORENDPROCHope this helpsRegardsGraemegraemepaulin2011-10-19 21:40:520
-
Dear Graeme,great answer. Thanks a lot.RegardsTobias0
Categories
- All Categories
- 5.6K RobotStudio
- 399 UpFeed
- 20 Tutorials
- 14 RobotApps
- 301 PowerPacs
- 406 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 336 IRC5
- 67 OmniCore
- 8 RCS (Realistic Controller Simulation)
- 830 RAPID Programming
- 13 AppStudio
- 4 RobotStudio AR Viewer
- 19 Wizard Easy Programming
- 107 Collaborative Robots
- 5 Job listings