RobotStudio event

Changing robtarget in real-time

Options
I'm trying to figure out how I can change a robtarget variable in semi real-time. i'm using a socket messaging-type system in which a PC is (in a loop) sending position and orientation data to to the controller (IRC5 with IRB2400 ROBOT). I'd like to take that data and throw it into a single robtarget variable (i.e. just over-write the variable over and over again) or just get the robot to move to that new position/orientation. I know that I can use the following to change the position:

MoveJ offs(CrobT(),xoffset,yoffset,zoffset,v500,z100,tool0)

in which the offset values can be variables, but this does not change the end-effector orientation quaternion. is there some way i can do this? it also seems that I cannot use variables in the robtarget definition as well.
I would appreciate any(!) help. Thanks!!

Comments

  • osku
    Options

    Hi

    If you want to modify the robtarget data, you can point to exact object for example:

    MyRobtarget.trans.x:=20;

    MyRobtarget.trans.y:=30;

    MyRobtarget.rot.q1:=1;

    and so on....

    In Rapid Reference manual there is well described the structure of robtarget (Functions and datatypes, robtarget). There you can see the different objects and syntax, how to point to these objects.

     

    -Oskari

  • Thanks for the reply!
    ...but would it work as, for example:

    VAR num xValue;
    xValue:=20;
    MyRobtarget.trans.x:=xValue;
    moveJ MyRobtarget, etc...

    or would there be a problem because robtarget expects constants only?

  • osku
    Options

    Yes, it works just as you described. No problem...

     

    -Oskari

  • osku
    Options

    One more thing, your robtarget should be defined as VAR or PERS before this works.

     

    -Oskari

  • okay - i will definitely give that a shot - thanks!!
  • Brilliant - thanks for your help!
    I can't believe I didn't think of that...It works when you edit the deepest branches: MyRobtarget.trans.x=..., but not when you set it in the MoveJ command itself...
  • osku
    Options

    You're welcome, glad to hear that you succeeded!

     

    -Oskari