Is it possible to modify the robtarget.pos.x coordinate of a ROBTARGET variable automatically?

Christopher_Pp
Christopher_Pp Santiago, Chile
I am looking to externally modify a graphically programmed position, of the type: 

    CONST robtarget NamePosision: = [[1598.461056774, -1860.729057189,350.083928981], [0,0.000004108,1,0], [- 1,0, -1,0], [ 9E + 09,9E + 09,9E + 09,9E + 09,9E + 09,9E + 09]];

The values ​​1598, 1860 and 350, are those corresponding to robtarget.pos.x, robtarget.pos.y, and robtarget.pos.z, respectively ... Those that I try to modify automatically by means of an arithmetic operation for example, to through RAPID, assigning new variables.

    CONST num x: = 1598.461056774;
    CONST num y: = -1860.729057189;
    CONST num z: = 350.083928981;
 
    VAR robtarget NamePosision: = [[x, y, z], [0,0.000004108,1,0], [- 1,0, -1,0], [9E + 09,9E + 09,9E + 09,9E + 09,9E + 09,9E + 09]];

The CONST variables num x, y, and z, only allow me to assign the data CONSTANT, if I create them of type VAR or PERS for example, it tells me that it must be CONST, but when doing the operation to assign a new value it tells me that it is read only and can not be modified. SIMPLE EXAMPLE: x = x + 1

I hope I have expressed myself correctly. Thank you very much!

Comments

  • graemepaulin
    graemepaulin New Zealand ✭✭✭
    Change the declaration of the Robtarget from Const to Pers (as well as the num variables).
  • Christopher_Pp
    Christopher_Pp Santiago, Chile
    Hi GRAEMEPAULIN, Thanks for answering...

    I made the change from CONST to PERS,

        PERS num x: = 1598.461056774;
        PERS num y: = -1860.729057189;
        PERS num z: = 350.083928981;
     
        PERS robtarget NamePosision: = [[x, y, z], [0,0,000004108,1,0], [- 1,0, -1,0], [9E + 09,9E + 09,9E + 09,9E + 09,9E + 09,9E + 09]];


     But the error manager tells me that there are syntax problems.

    - IRB_660_250kg_3.15m_3 / RAPID / T_ROB1 / Module1 (17232,42): Syntax error (135): Num. 03/04/2018 21:01:53 General considerations.
    - IRB_660_250kg_3.15m_3 / RAPID / T_ROB1 / Module1 (17232,43): Syntax error (135): Identifier expected. 03/04/2018 21:01:53 General considerations.
    - IRB_660_250kg_3.15m_3 / RAPID / T_ROB1 / Module1 (17232,47): Syntax error (136): ']' was not expected. 03/04/2018 21:01:53 General considerations.

    All of them make reference to this excerpt from the robtarget point.

    I hope you can help me. Best regards!


  • graemepaulin
    graemepaulin New Zealand ✭✭✭

    You need to have numbers in the robtarget

     PERS robtarget NamePosision: = [[0,0,0,], [0,0,000004108,1,0], [- 1,0, -1,0], [9E + 09,9E + 09,9E + 09,9E + 09,9E + 09,9E + 09]];
    You then update the x, y, or z values in the RAPID, as below:
    NamePosision.trans.x:=x;
    NamePosision.trans.y:=y;
    NamePosision.trans.z:=z;

  • Christopher_Pp
    Christopher_Pp Santiago, Chile
    I do what you tell me ...


    But I throw the following error ... Something I'm doing wrong!

    "IRB_660_250kg_3.15m_3 / RAPID / T_ROB1 / Module1 (17227,5): Data declaration error (94): Persistent variable declaration not allowed in the routine. 03/04/2018 22:34:59 General considerations"

  • Christopher_Pp
    Christopher_Pp Santiago, Chile
    I made a mistake there ... I'm sorry ...
  • Christopher_Pp
    Christopher_Pp Santiago, Chile
    I already did it correctly and it works perfectly ... Thank you very much for your answers and your time! :)
  • Toby
    Toby Mesa AZ
    im doing something similar except my robot is on a track so I have mine looking like this:

    PERS robtarget pBackSet:=[[6652.,-1606.93,856.53],[0.488507,0.509356,0.507896,-0.493922],[0,0,-1,1],[6640.,9E+09,9E+09,9E+09,9E+09,9E+09]];

    What do I use for the track instead of "trans.x"

  • lemster68
    lemster68 United States ✭✭✭
    pBackSet.eax.a  could be underscore _a
    Lee Justice
  • Toby
    Toby Mesa AZ
    will try thank you
  • Toby
    Toby Mesa AZ
           So the code I have now is:
        PERS robtarget pRightEnd:=[[0,13.06,-8.79],[0.486852,-0.512594,0.514645,0.485143],[-1,-1,0,1],[0,9E+09,9E+09,9E+09,9E+09,9E+09]];
        PERS robtarget pColumnCTR:=[[0,-1606.93,856.53],[0.488507,0.509356,0.507896,-0.493922],[0,0,-1,1],[0,9E+09,9E+09,9E+09,9E+09,9E+09]];
            nPartLenMM:=ColumnLen*25.4;
            nPartLenMMH:=nPartLenMM/2.;
            nXPOS:=nPartLenMMH;
            pRightEnd.trans.x:=nXPos+3.225-12.7;
            pRightEnd.eax_a:=6640.35-nXPos+600.;
            pColumnCTR.trans.x:=nXPos+6662.42-12.7;
            pColumnCTR.eax_a:=nXPos+6640.35-822.05;



    The eax_a is for the numbers bold? Is there a different variable for the Track, pictured below:

  • lemster68
    lemster68 United States ✭✭✭
    Ok I left one thing out.  It has been a while.  Use syntax .extax.eax_a:=what_number_you_need_here;
    Lee Justice
  • Toby
    Toby Mesa AZ
    should there be a space behind the syntax?
  • lemster68
    lemster68 United States ✭✭✭
    Syntax refers to the required way you have to write the code, it is not part of the code.  pMyRobtarget.extax.eax_a:=100; for example.
    Lee Justice
  • Toby
    Toby Mesa AZ
    Thank you Lee!!!! WooHoo it works....
  • lemster68
    lemster68 United States ✭✭✭
    You are welcome.   :)
    Lee Justice