Using LIN motion with variables

  • Hi,


    I'm running KRC2 with a KUKA KR-60 robot.


    I would like to program a linear motion on the A-axis, but using a variable for the specified position.


    For example,


    This works:


    lin {A 30}


    but this doesnt:


    decl real apos


    apos=30


    lin{A apos}


    I get the error message "Constant expected"


    Is there any way around this?


    Thanks for your time and help,


    Alex Brady

  • [size=2]read manual.... motion instructions require parameter of type structure and it has to be one of: FRAME, POS, E6POS, AXIS or E6AXIS.[/size]


    [size=2]note that REAL data type is not one of them, it is simple type, not a structure.[/size]
    [size=2]further more, curly brace indicates structure but... is a constant, so all of its elements must be constants too (literals).[/size]



    X = Y + 5 ; note "X" and "Y" are variables, but "5" is a literal




    therefore you cannot do what you want the way you want.





    try



    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

Advertising from our partners