Shift wobj

  • Place your Ad here!
  • Hi gdicolandrea,


    What are you trying to do? A work object [or frame] has to be defined using 3 points (X dir Y dir and the Origin] .Once the Object Frame is defined you can offset [shift] the user frame within the Object frame.


    PERS wobjdata wobj_01:=[FALSE,TRUE,"",[[-3008.35,3277.1,1442.26],[0.706091,0.708118,0.00158178,-0.000807417]],[[0,0,0],[1,0,0,0]]];


    The above is a defined wobj without a user frame shift (......[[0,0,0],[1,0,0,0]]];.........)


    PERS wobjdata wobj_01:=[FALSE,TRUE,"",[[-3008.35,3277.1,1442.26],[0.706091,0.708118,0.00158178,-0.000807417]],[[100,10,-20],[1,0,0,0]]];


    The above is a defined wobj with a user frame shift (......100mm in X dir, 10mm in Y dir & -20mm in Z dir) You can also rotate the wobj by defining the quarternion values [1,0,0,0=no rotation] [0,0,0,1=180deg rotation]


    This is also explained in the User Rapid Manuals........

  • I'm going to assume that you are being given group inputs for the data. Here is a quick, rough explanation of how it works. just a starting point, not a real program.


    So if you have the following inputs from plc:
    giTransX=10
    giTransY=20
    giTransZ=30


    and the following workobjects:
    wobjOriginal:=[FALSE,TRUE,"",[[100,200,300],[1,0,0,0]],[[0,0,0],[1,0,0,0]]];
    wobjWork:=[FALSE,TRUE,"",[[100,200,300],[1,0,0,0]],[[0,0,0],[1,0,0,0]]];


    Then you could do the following:
    PROC example()
    wobjWork.oframe.transX:=giTransX;
    wobjWork.oframe.transY:=giTransY;
    wobjWork.oframe.transZ:=giTransZ;
    !would result in wobjWork:=[FALSE,TRUE,"",[[100,200,300],[1,0,0,0]],[[10,20,30],[1,0,0,0]]];
    !all work goes here
    wobjWork:=wobjOriginal
    !would result in wobjWork:=[FALSE,TRUE,"",[[100,200,300],[1,0,0,0]],[[0,0,0],[1,0,0,0]]];
    ENDPROC

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account
Sign up for a new account in our community. It's easy!
Register a new account
Sign in
Already have an account? Sign in here.
Sign in Now

Advertising from our partners