RobotStudio event

Array of Rob targets

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

Comments

  • lemster68
    lemster68 ✭✭✭
    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.
    Lee Justice
  • Thanks i will try this again. Has to be my syntax somewhere
  • 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

  • lemster68
    lemster68 ✭✭✭
    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.  :)
    Lee Justice
  • 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!!
  • DenisFR
    DenisFR ✭✭✭
    edited June 2018
    Hello,
    Never forget to check if positions are changed after to update your array.
    So you can teach them:
                pTempAppro:=pApproPoint{nPntGCPlaceWait};<br>            MoveL pTempAppro,v1000,fine,temp_tool;<br>            pTempLoc:=pLocPoint{nPntGCPlaceWait};<br>            MoveL pTempLoc,v1000,fine,temp_tool;<br>            IF pApproPoint{nPntGCPlaceWait}<>pTempAppro pApproPoint{nPntGCPlaceWait}:=pTempAppro;<br>            IF pLocPoint{nPntGCPlaceWait}<>pTempLoc pLocPoint{nPntGCPlaceWait}:=pTempLoc;<br>