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.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 310 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 786 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings