# Robtargets to array

**URL:** <https://tech-community.robotics.abb.com/t/robtargets-to-array/7523>\
**Category:** Developer Tools\
**Tags:** array, robtarget\
**Created:** [January 12, 2017, 9:06am UTC](https://tech-community.robotics.abb.com/t/robtargets-to-array/7523 "2017-01-12T09:06:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ricki](https://avatars.discourse-cdn.com/v4/letter/r/3ec8ea/32.png) [@Ricki](https://tech-community.robotics.abb.com/u/Ricki)\
**Post date:** [January 12, 2017, 9:06am UTC](https://tech-community.robotics.abb.com/t/robtargets-to-array/7523/1 "2017-01-12T09:06:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![John\_Verheij](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/john_verheij/32/1724_2.png) [@John\_Verheij](https://tech-community.robotics.abb.com/u/John_Verheij)\
**Post date:** [February 3, 2017, 8:34am UTC](https://tech-community.robotics.abb.com/t/robtargets-to-array/7523/2 "2017-02-03T08:34:05Z")

</div>

It depends on the names of the robtargets. You can do something like this:

```auto

MODULE MainR1

  

  PERS robtarget p1 := [[1000,0,400],[0,1,0,0],[0,0,0,0],[9e9,9e9,9e9,9e9,9e9,9e9]];

  PERS robtarget p2 := [[1000,0,500],[0,1,0,0],[0,0,0,0],[9e9,9e9,9e9,9e9,9e9,9e9]];

  PERS robtarget p3 := [[1000,0,600],[0,1,0,0],[0,0,0,0],[9e9,9e9,9e9,9e9,9e9,9e9]];

  PERS robtarget p4 := [[1000,0,700],[0,1,0,0],[0,0,0,0],[9e9,9e9,9e9,9e9,9e9,9e9]];

  PERS robtarget ps{4};

  

  PROC main()

    VAR robtarget pTemp;

    

    FOR i FROM 1 TO 4 DO

      GetDataVal "p" + ValToStr(i), pTemp;

      ps{i} := pTemp;

    ENDFOR

    

  ENDPROC

  

ENDMODULE

```

---

<div class="post-metadata">

**Author:** ![Ricki](https://avatars.discourse-cdn.com/v4/letter/r/3ec8ea/32.png) [@Ricki](https://tech-community.robotics.abb.com/u/Ricki)\
**Post date:** [February 24, 2017, 11:35am UTC](https://tech-community.robotics.abb.com/t/robtargets-to-array/7523/3 "2017-02-24T11:35:25Z")

</div>

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?
