# Array of Rob targets

**URL:** <https://tech-community.robotics.abb.com/t/array-of-rob-targets/8244>\
**Category:** Developer Tools\
**Created:** [May 22, 2018, 8:21am UTC](https://tech-community.robotics.abb.com/t/array-of-rob-targets/8244 "2018-05-22T08:21:24Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlanAutoTech](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/alanautotech/32/3398_2.png) [@AlanAutoTech](https://tech-community.robotics.abb.com/u/AlanAutoTech)\
**Post date:** [May 22, 2018, 8:21am UTC](https://tech-community.robotics.abb.com/t/array-of-rob-targets/8244/1 "2018-05-22T08:21:24Z")

</div>

Traditional Coding inside rapid..  
So {} defines an Array for Normal Usage int,Strings… and the suffix instantiates the object variables.  
PERS robtarget pApproGoodConv:=[[0,0,0],[0,0,0,0],[0,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];  
Instead of making a Single element object of type robtarget.  
How do i make pLocPoint{25}  
Then i can manipulate my array as needed by passing by ref movej pLocPoint[nPallet1] …  
Setting up the array is where i seem to be failing in my interpretation of the construct

---

<div class="post-metadata">

**Author:** ![lemster68](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/lemster68/32/1945_2.png) [@lemster68](https://tech-community.robotics.abb.com/u/lemster68)\
**Post date:** [May 22, 2018, 12:02pm UTC](https://tech-community.robotics.abb.com/t/array-of-rob-targets/8244/2 "2018-05-22T12:02:33Z")

</div>

You almost got it already in your question. VAR robtarget pLocPoint{25}; would do it, you don’t have to fill in all the placeholders. But if you really must have them there for whatever reason;

PERS robtarget pLocPoint{2}:=[[[1603.61,188.98,277.66],[0.328996,0.213965,0.916037,-0.082806],[0,0,2,0],[-0.0024727,-139.994,9E+09,9E+09,9E+09,9E+09]],[[1603.61,188.98,277.66],[0.328996,0.213965,0.916037,-0.082806],[0,0,2,0],[-0.0024727,-139.994,9E+09,9E+09,9E+09,9E+09]]];

Each one inside the braces separated by a comma.

---

<div class="post-metadata">

**Author:** ![AlanAutoTech](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/alanautotech/32/3398_2.png) [@AlanAutoTech](https://tech-community.robotics.abb.com/u/AlanAutoTech)\
**Post date:** [June 14, 2018, 11:01am UTC](https://tech-community.robotics.abb.com/t/array-of-rob-targets/8244/3 "2018-06-14T11:01:01Z")

</div>

Thanks i will try this again. Has to be my syntax somewhere

---

<div class="post-metadata">

**Author:** ![AlanAutoTech](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/alanautotech/32/3398_2.png) [@AlanAutoTech](https://tech-community.robotics.abb.com/u/AlanAutoTech)\
**Post date:** [June 14, 2018, 11:01am UTC](https://tech-community.robotics.abb.com/t/array-of-rob-targets/8244/4 "2018-06-14T11:01:01Z")

</div>

So for those Ever looking and need the final Result [Special Help from lemster68], here.  
Named Constants to make a clean are Structured approach to point storage…

PROC PlaceConv(num index)  
nRetConv:=nNothing;  
!Check Safe Zone Clear before proceeding.  
!IF Not Clear Wait at the Base Approach Pos until Clear  
APPGC;  
IF bApproSuccess THEN  
pTempPoint:=pApproPoint{nPntGCPlaceWait};  
MoveL pTempPoint,v1000,fine,temp\_tool;  
pTempPoint:=pLocPoint{nPntGCPlaceWait};  
MoveL pTempPoint,v1000,fine,temp\_tool;  
ENDIF  
nRetConv:=nSuccess;  
RETURN ;  
ENDPROC

---

<div class="post-metadata">

**Author:** ![lemster68](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/lemster68/32/1945_2.png) [@lemster68](https://tech-community.robotics.abb.com/u/lemster68)\
**Post date:** [June 14, 2018, 6:28pm UTC](https://tech-community.robotics.abb.com/t/array-of-rob-targets/8244/5 "2018-06-14T18:28:27Z")

</div>

So I suppose you figured out how to modpos those? (Have to go to program data into robtarget array.) And howdy neighbor, Fountain Inn here. 🙂

---

<div class="post-metadata">

**Author:** ![AlanAutoTech](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/alanautotech/32/3398_2.png) [@AlanAutoTech](https://tech-community.robotics.abb.com/u/AlanAutoTech)\
**Post date:** [June 19, 2018, 7:12am UTC](https://tech-community.robotics.abb.com/t/array-of-rob-targets/8244/6 "2018-06-19T07:12:13Z")

</div>

So for those Ever looking and need the final Result [Special Help from lemster68], here.  
Named Constants

PROC PlaceConv(num index)  
nRetConv:=nNothing;  
!Check Safe Zone Clear before proceeding.  
!IF Not Clear Wait at the Base Approach Pos until Clear  
APPGC;  
IF bApproSuccess THEN  
pTempPoint:=pApproPoint{nPntGCPlaceWait};  
MoveL pTempPoint,v1000,fine,temp\_tool;  
pTempPoint:=pLocPoint{nPntGCPlaceWait};  
MoveL pTempPoint,v1000,fine,temp\_tool;  
ENDIF  
nRetConv:=nSuccess;  
RETURN ;  
ENDPROC

And to boot Make sure you assign(insinuate) each element in the arrary or your points are gone on power cycle.. Just saying!!

---

<div class="post-metadata">

**Author:** ![DenisFR](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@DenisFR](https://tech-community.robotics.abb.com/u/DenisFR)\
**Post date:** [June 19, 2018, 7:43am UTC](https://tech-community.robotics.abb.com/t/array-of-rob-targets/8244/7 "2018-06-19T07:43:34Z")

</div>

Hello,  
Never forget to check if positions are changed after to update your array.  
So you can teach them:

```auto
            pTempAppro:=pApproPoint{nPntGCPlaceWait};
            MoveL pTempAppro,v1000,fine,temp_tool;
            pTempLoc:=pLocPoint{nPntGCPlaceWait};
            MoveL pTempLoc,v1000,fine,temp_tool;
            IF pApproPoint{nPntGCPlaceWait}<>pTempAppro pApproPoint{nPntGCPlaceWait}:=pTempAppro;
            IF pLocPoint{nPntGCPlaceWait}<>pTempLoc pLocPoint{nPntGCPlaceWait}:=pTempLoc;

```
