Hello,
I have a doubt about the use of RelTool not within a Move instruction. To clarify what I mean, I’ll make an example:
CONST robtarget Target_10:=[[0,550,300],[-0.000000005,0.707106781,0.707106781,0.000000005],[0,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget Home:=[[302,0,558],[0,0,1,0],[0,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
PERS wobjdata wobj1:=[FALSE,TRUE,“”,[[1000,0,0],[0.707106781,0,0,0.707106781]],[[0,0,0],[1,0,0,0]]];
PERS robtarget p1;
PROC main()
MoveJ Home,vmax,fine,tool0\WObj:=wobj0;
IF bMod = 1 THEN !bMod is a DI that I used in the simulation to distinguish the 2 cases
p1:= RelTool(Target_10,100,0,0);
MoveJ p1, v100,fine,tool0\WObj:=wobj1;
ELSE
MoveJ RelTool(Target_10,100,0,0), v100,fine,tool0\WObj:=wobj1;
ENDIF
ENDPROC
bMod allow me to choose between using RelTool inside the MoveJ instruction (bMod=0) or not.
In the simulation I see that the robot reaches the same point in both cases, with translation coordinates: [0,650,300].
However, to me the case with bMod=1 does not make sense: it defines p1 as a displacement in the tool coordinate of tool frame of 100 mm along x axis, but regarding which workobject? I thought wobj0 since it is the workobject used in the previous motion to Home, but it’s not like that; actually it’s like it is considering wobj1 (you can see it from the coordinate values [0,650,300]).
So, while in the case bMod = 0 the robot know we are moving (and then computing the position) with respect to wob1, how does he know we are considering that wobj in case bMod = 1?
I was actually expecting Rapid to give me an error using RelTool not within a Move instruction.
Thank you