Robtargets to array
Ricki
✭
Hi
Is thear an easy way to convert robtargets to an array? For exampel when you creat a lot of targets in studio simulaition the are all defined with theire own name. An when I move them to the real controller and want to use them in an array, I have to manual reorganize/copy them to an array. Of course I could creat som WHILE/FOR loops and use the SetDataSearch/GetNextSym functions to automaticly move them to array.
Some good advices?
Sorry for my bad english
-Rick
Is thear an easy way to convert robtargets to an array? For exampel when you creat a lot of targets in studio simulaition the are all defined with theire own name. An when I move them to the real controller and want to use them in an array, I have to manual reorganize/copy them to an array. Of course I could creat som WHILE/FOR loops and use the SetDataSearch/GetNextSym functions to automaticly move them to array.
Some good advices?
Sorry for my bad english
-Rick
0
Answers
-
It depends on the names of the robtargets. You can do something like this:
<div>MODULE MainR1<br></div><div> <br></div><div> PERS robtarget p1 := [[1000,0,400],[0,1,0,0],[0,0,0,0],[9e9,9e9,9e9,9e9,9e9,9e9]];<br></div><div> PERS robtarget p2 := [[1000,0,500],[0,1,0,0],[0,0,0,0],[9e9,9e9,9e9,9e9,9e9,9e9]];<br></div><div> PERS robtarget p3 := [[1000,0,600],[0,1,0,0],[0,0,0,0],[9e9,9e9,9e9,9e9,9e9,9e9]];<br></div><div> PERS robtarget p4 := [[1000,0,700],[0,1,0,0],[0,0,0,0],[9e9,9e9,9e9,9e9,9e9,9e9]];<br></div><div> PERS robtarget ps{4};<br></div><div> <br></div><div> PROC main()<br></div><div> VAR robtarget pTemp;<br></div><div> <br></div><div> FOR i FROM 1 TO 4 DO<br></div><div> GetDataVal "p" + ValToStr(i), pTemp;<br></div><div> ps{i} := pTemp;<br></div><div> ENDFOR<br></div><div> <br></div><div> ENDPROC<br></div><div> <br></div><div>ENDMODULE</div>
0 -
Thanks for the answer, already did that. But isn’t this something that could be done offline in studio when synchronize sing targets to rapid? Or when you have lots of targets in same path?
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)
- 785 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings